reficio / p2-maven-plugin

Maven3 plugin that automates the third-party dependency management for Eclipse RCP
http://reficio.org
230 stars 100 forks source link

Add a way to set default bnd instructions #132

Open tcataldo opened 6 years ago

tcataldo commented 6 years ago

Hi, We had to switch to reficio 1.3.0 to integrate a java 1.8 artifact as an osgi bundle (through the new bnd version). The problem is that the new bnd generates a Require-Capability manifest entry on all our bundles.

eg. for guava we get "Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.6))" and for another bundle we get "Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.7))". As we run with java8 those bundles are not loadable anymore.

Is the a way to change the default bnd intructions from

<instructions>
    <Import-Package>*;resolution:=optional</Import-Package>
    <Export-Package>*</Export-Package>
</instructions>

to

<instructions>
    <Import-Package>*;resolution:=optional</Import-Package>
    <Export-Package>*</Export-Package>
    <Require-Capability>osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.8))</Require-Capability>
</instructions>

or just present this manifest entry from being generated. I read about a "noee" bnd instruction but if I had to add that to every bundle and its transitive dependencies, that will be a mess.

tJeyhun commented 5 years ago

How can add I use -noee bnd instruction with p2-maven-plugin? Is it possible with current version?

jdiazgon commented 5 years ago

Is there any update on this? Any workaround?

I'm facing similar issue but with Java 9 version: Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=9.0))". We are using Java 8 and we don't want to switch all our software to that version.

haltunbay commented 4 years ago

Hi, We are having a similar problem while generating a bundle from a non-osgi compatible jar. It adds "Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.1))" to manifest. Which causes getting a validation warning in eclipse. Any solution planned? Thanks

sparsick commented 3 years ago

As workaround, you can use the following bnd instruction:

                               <artifact>
                                    <id>org.jdom:jdom2:2.0.6</id>
                                    <override>true</override>
                                    <instructionsProperties>
                                        <property>
                                            <name>-noee</name>
                                            <value>true</value>
                                        </property>
                                    </instructionsProperties>
                                </artifact>