felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <fmesc...@adobe.com>
Subject Re: How can I stop maven-bundle-plugin from injecting a version-range for Import-Package
Date Wed, 07 Nov 2012 08:56:06 GMT

Am 07.11.2012 um 08:54 schrieb Dileepa Jayakody:

> Hi All,
> We are having a problem using maven-bundle-plugin to build our bundles,
> where it injects a version-range (I think it computes the version range
> from the compile-time maven-dependency) to the bundle's Import-Packages.
> For eg : when I have specified an Import-Package: org.foo.bar; The plugin
> injects a version range like Import-Package: org.foo.bar;version="[1.0.0,
> 2.0.0)" probably by computing from the compile time dependency version of
> the maven artifact exposing org.foo.bar package.
> The problem is many of our producer bundles are not exporting their
> packages with versions. So when the bundle-plugin computes and injects a
> version range to relevant consumer bundle's Import-Package, the resolution
> get broken because there is no exporter for that package within the
> required version-range.
> I know, we should manage versions in Exports/Imports properly but it's not
> manageable at the moment with the number of bundles has exceeded 300.

So your dependencies expose exported package version and your deployed bundles don't ? This
sounds like a strange situation.

Looks like you are building against newer versions than the deployed ones ? If so, I suggest
to build against the same versions as you have deployed.

In general my take on this is to always compile to the lowest version dependency that meets
the (API) needs of the code you are compiling. This way your lower version in the range will
really expose what the bundle needs and you will have less surprises at deployment time.

The idea is that you develop with a certain version of a dependency (even though Maven's dependencies
and OSGi's Import-Package need not be the same) and that you expect at least that version
of the dependency or a newer one to be actually deployed.


> Can I please know how can I explicitly avoid the version-range injected to
> Import-Package? Is this feature of computing version-range for Imports
> added to maven-bundle-plugin (bnd) in a recent released version?
> We are using 2.3.5 version of the bundle-plugin.
> If this feature has been added to a recent version of the plugin , can you
> please specify an older version of the bundle-plugin that doesn't compute
> version ranges for Import-Package?
> At the moment our immediate requirement is to stop adding version-ranges
> for Import-Package
> Appreciate your insight on this.
> Thanks,
> Dileepa

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

View raw message