yes, the maven-bundle-plugin will read the MANIFEST.MF of the third party
bundle, if it exports the package with some kind version number like
1.2.1.  maven-bundle-plugin will generated the import package with the
version rang of [1.2, 2).
You can override it by specify the import package version rang in the
maven-bundle-plugin.

Willem

On Wed, Nov 23, 2011 at 1:36 PM, Freeman Fang <[email protected]>wrote:

> Hi,
>
> maven-bundle-plugin basically just analyze the dependency in pom.xml and
> generate OSGi meta-data header in MANIFEST.MF accordingly, you need check
> if your dependency introduce this package import.
> Btw, you can configure the maven-bundle-plugin to totally control the OSGi
> meta-data header.
>
> Freeman
>
> On 2011-11-23, at 下午1:27, XiLai Dai wrote:
>
> Thanks Freeman for your clear reply!****
> ** **
> BTW, I’ve run another test with the same bundle which just removed the
> “org.osgi.service.blueprint;version="[1.0.0,2.0.0)” from MANIFEST.MF, then,
> it has been installed into Karaf successfully.****
> So, maybe it’s a problem from maven-bundle-plugin, it should not generate
> the unexpected “org.osgi.service.blueprint;version="[1.0.0,2.0.0)” into
> MANIFEST.MF.****
> ** **
> Thanks.****
> Xilai****
> *From:* Freeman Fang [mailto:[email protected]<[email protected]>
> ]
> *Sent:* Wednesday, November 23, 2011 11:52 AM
> *To:* [email protected]
> *Subject:* Re: Package uses conflict: Import-Package:
> org.osgi.service.blueprint****
> ** **
> Hi,****
> ** **
> This kind of "Package uses conflict" comes from the scenario
> like, let's say, ****
> bundle A import-package org.osgi.service.blueprint;
> version="[1.0.0,2.0.0)", bundle A also import-package x.y.z****
> bunde B export-package  x.y.z with "use" directive like
> uses:="org.osgi.service.blueprint; version="[2.0.0,3.0.0)"" ****
> Let's say bundle B already get resolved and started.****
> When resolve bundle A, it will use export-package x.y.z from bundle B, but
>  as bundle B export-package  x.y.z uses:="oorg.osgi.service.blueprint;
> version="[2.0.0,3.0.0)" and bundle B get resolved to
> import org.osgi.service.blueprint; version="[2.0.0,3.0.0), so it's not meet
> bundle A's restriction which need org.osgi.service.blueprint;
> version="[1.0.0,2.0.0)(notice the version mismatch between the two), then
> you see such exception.****
> ** **
> The root cause is that you install some bundles which need
> different org.osgi.service.blueprint versions, also those bundles has
> dependency with each other, you need figure it out from your bundles and
> fix it.****
> ** **
> Freeman****
> On 2011-11-23, at 上午11:36, XiLai Dai wrote:****
>
>
> ****
> Hello,
>
> We have a bundle with blueprint (OSGI-INF/blueprint/xxx.xml) and build
> with maven-bundle-plugin.
> The META-INF/ MANIFEST.MF contains:
> ......
> Import-Package: ...,org.osgi.service.blueprint;version="[1.0.0,2.0.0)",...
>
> When install this bundle into Karaf 2.2.4, got error:
> Reason: Package uses conflict: Im port-Package:
> org.osgi.service.blueprint; version="[1.0.0,2.0.0)"
>
> Why it complains there has conflict?
>
> Thanks.
> Xilai****
> ** **
> ---------------------------------------------****
> Freeman Fang****
> ** **
> FuseSource****
> Email:f <[email protected]>[email protected]****
> Web: fusesource.com****
> Twitter: freemanfang****
> Blog: http://freemanfang.blogspot.com****
> ** **
> ** **
> ** **
> ** **
> ** **
> ** **
> ** **
> ** **
> ** **
>
>
> ---------------------------------------------
> Freeman Fang
>
> FuseSource
> Email:f <[email protected]>[email protected]
> Web: fusesource.com
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
>
>
>
>
>
>
>
>
>
>

Reply via email to