karaf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Freeman Fang <freeman.f...@gmail.com>
Subject Re: [maven-bundle-plugin] "shading" version issue
Date Wed, 15 Dec 2010 03:27:07 GMT

On 2010-12-15, at 上午5:16, Mike Van wrote:

>
> 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".
Hi,
Although not sure why Export-Package version doesn't work for you, the  
specified Export-Package version absolutely works, that's what we do  
for servicemix bundle repository[1], where OSGi-fied those jars which  
isn't friendly with OSGi,  I believe it's same goal with your  
requirement, you may need take a look to get details how we do there.

[1]https://svn.apache.org/repos/asf/servicemix/smx4/bundles/trunk/

Freeman
>
> 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.


-- 
Freeman Fang

------------------------

FuseSource: http://fusesource.com
blog: http://freemanfang.blogspot.com
twitter: http://twitter.com/freemanfang
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Mime
View raw message