You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Will Horn <wi...@gmail.com> on 2009/05/14 20:44:58 UTC

[maven-bundle-plugin] suppress version on import-package

Is it possible to suppress the version completely on import-package?  I've
tried many variations for <_versionpolicy>, but have not been able to find a
working recipe.
-- 
View this message in context: http://www.nabble.com/-maven-bundle-plugin--suppress-version-on-import-package-tp23546224p23546224.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: [maven-bundle-plugin] suppress version on import-package

Posted by Will Horn <wi...@gmail.com>.
Thanks Stuart.  This is just one of my many hack attempts to bridge the
worlds of maven and OSGi.  I have a post a few days ago (May 12) that
explains more details what I am doing.   Here's a diagram:

                   Eclipse RCP project
                      /               \
     Maven project A       Maven project B
             |                            |
       dependencies            dependencies

A's dependencies and B's dependencies overlap (and there are actually many
other projects C, D, E, etc) so I am using the bundle plugin to get the
union of all the maven dependencies and put them into a single "thirdparty"
bundle that embed's the jars and exports all packages (with no versions).

When I generate the manifest for projects A and B, the bundle plugin sees
the maven dependency on say apache lang v 2.4 and will automatically add
that version to the import-package.  But apache lang is actually embedded in
the "thirdparty" bundle and doesn't have that version number.

As I mentioned in my last post, I would prefer each maven dependency be in
it's own bundle, but out of the ~80 dependencies, only ~30 are OSGi bundles. 
I don't want to deal with creating poms for the other 50, and I haven't been
able to get the bundeall goal to do what I need.

Thanks,
Will


-- 
View this message in context: http://www.nabble.com/-maven-bundle-plugin--suppress-version-on-import-package-tp23546224p23563639.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: [maven-bundle-plugin] suppress version on import-package

Posted by Stuart McCulloch <mc...@gmail.com>.
2009/5/15 Will Horn <wi...@gmail.com>

>
> Is it possible to suppress the version completely on import-package?  I've
> tried many variations for <_versionpolicy>, but have not been able to find
> a
> working recipe.


you can either set the version to 0 (which then matches all versions)

   <Import-Package>*;version=0</Import-Package>

or you can set the version attribute to ! which tells BND to remove it
completely
( http://aqute.biz/Code/Bnd#import-package the bit about removing attributes
)

   <Import-Package>*;version=!</Import-Package>

any particular reason why you need this? matching against any version could
lead to problems in the future if the matched version is not binary
compatible

--
> View this message in context:
> http://www.nabble.com/-maven-bundle-plugin--suppress-version-on-import-package-tp23546224p23546224.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>

-- 
Cheers, Stuart