p2-maven-plugin icon indicating copy to clipboard operation
p2-maven-plugin copied to clipboard

"Package uses conflict" when using artifacts which export the same package

Open thSoft opened this issue 10 years ago • 0 comments

When I build an update site containing org.apache.hadoop:hadoop-common:2.7.1 using this plugin, I use it in one of my bundles and include it transitively in my RCP product, it fails to run with:

!MESSAGE Package uses conflict: Require-Bundle: org.apache.hadoop.common; bundle-version="0.0.0"

This is because both hadoop-common and one of its dependencies, hadoop-auth export a package called org.apache.hadoop.util without a version number, hence when activating the bundles of my product, a package uses conflict occurs. (For more info, see Solving OSGi "Uses" Constraint Violations.)

I tried to not export this package from hadoop-auth:

<artifact>
    <id>org.apache.hadoop:hadoop-auth:2.7.1</id>
    <instructions>
        <Import-Package>*;resolution:=optional</Import-Package>
        <Export-Package>!org.apache.hadoop.util,*</Export-Package>
    </instructions>
</artifact>

but it did not solve the problem. Could the default instructions be modified to make this kind of artifacts work?

thSoft avatar Jan 07 '16 16:01 thSoft