karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Van <mvangeert...@comcast.net>
Subject [maven-bundle-plugin] "shading" version issue
Date Tue, 14 Dec 2010 21:16:24 GMT

When using the maven-bundle-plugin to group non-bundled or improperly bundled
packages into a new bundle, I noticed that the version number of the
resulting packages is set to "0.0.0".  Is there any way to fix this?  Below
is some code that should allow you to see the problem:

<build>
  <plugins>
     <plugin>
       <groupId>org.apache.felix</groupId>
       <artifactId>maven-bundle-plugin</artifactId>
       <version>2.1.0</version>
       <extensions>true</extensions>
       <configuration>
        <Export-Package>
          bad.vendor.package1;version="0.1.2",
          bad.vendor.package2;version="3.2.3",
          bad.vendor.package3;version="4.3.4"
        </Export-Package>
      </configuration>
     </plugin>
   </plugins>
   <dependencies>all the bad.vendor dependencies containing the above
packages</dependencies>

This results in a file where the packages are not versioned, so when the
resultant bundle is deployed into OSGi, all of the packages are set to
version 0.0.0.

In cases where we are shading together .jar files that are no longer in
development, or .jar files from vendors that simply won't play osgi well, we
create a maven-project and create this bundle along with each versioned
release of our product.  As our project grows, contracts, or changes, we
need to add or remove things from this bundle.  Because the package versions
are always set to 0.0.0, there is the possibility of ClassNotFound or
constraint violations.

It would be a good idea to have a way to change the behavior of this plugin
to allow the user to set the resultant package versions, or to override the
default behavior to use the ${pom.version} for each package instead of
"0.0.0".

v/r,

Mike Van (karafman)

-- 
View this message in context: http://karaf.922171.n3.nabble.com/maven-bundle-plugin-shading-version-issue-tp2088176p2088176.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Mime
View raw message