java - maven-bundle-plugin Creates unexpected Import-Package content -
i build bundles using maven-bundle-plugin
, after tests pax:provision
found creating import-package=org.osgi.framework;version="[1.8,0)"
on bundles , @ moment of installing bundles in felix bundles unresolved because of org.osgi.framework.bundleexception: unresolved constraint in bundle com.domain.mybundle [55]: unable resolve 55.0: missing requirement [55.0] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0)))
.
why maven-bundle-plugin
creating header if have no direct dependency package. tried add dependency:
<dependency> <groupid>org.apache.felix</groupid> <artifactid>org.apache.felix.framework</artifactid> <version>4.6.0</version> </dependency>
and still uses version 1.8.0
. idea why?
update
checking again, bundles use org.osgi.framework
in activator. class org.osgi.framework.bundleactivator
comes bundle:
<dependency> <groupid>org.osgi</groupid> <artifactid>org.osgi.core</artifactid> <version>4.3.1</version> <scope>provided</scope> <optional>true</optional> </dependency>
so again, why isn't maven-bundle-plugin
using version 4.3.1
instead of 1.8.0
? , in other bundles uses version 1.6.2
.
update 20-3-2015
this exception receive after executing mvn pax:provision
org.osgi.framework.bundleexception: unresolved constraint in bundle org.classdomain.per sistence [47]: unable resolve 47.0: missing requirement[47.0] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(version>=2.0.0)))error: bundle org.classdomain.persistence [47] error starting file:bundles/org.classdomain.per sistence_0.1.0.jar (org.osgi.framework.bundleexception: unresolved constraint in bundle org.classdomain.persistence [47]: unable resolve 47.0: missing requirement [47.0] o sgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.8.0)(!(versio n>=2.0.0)))) @ org.apache.felix.framework.felix.resolvebundlerevision(felix.java:4002) @ org.apache.felix.framework.felix.startbundle(felix.java:2045) @ org.apache.felix.framework.felix.setactivestartlevel(felix.java:1299) @ org.apache.felix.framework.frameworkstartlevelimpl.run(frameworkstartlevelimpl.java:304) @ java.lang.thread.run(thread.java:745)
definitely, seems exception happens when using mvn pax:provision
, if install same bundles in stand alone felix instance every thing works expected.
the import-package statements built according defined package versions in libraries use. in case have dependency org.apache.felix.framework defines these exports (e.g. org.osgi.framework version 1.8) in manifest.
if have depenency org.osgi.core 4.3.1 package org.osgi.framework should defined version 1.6. should work.
Comments
Post a Comment