Tuesday, 15 March 2011

java - maven-bundle-plugin Creates unexpected Import-Package content -


I created all my bundles using maven-bundle-plugin and With some tests after peace: Provisioning I found that it is a import-package = org.osgi.framework on all bundles; Version = "[1.8,0]" bundle is time to install Felix made because I get unsolved all their bundles org.osgi.framework.BundleException: unresolved obstacle bundled com .domain.mybundle [55]: Unable to resolve 55.0: missing requirement [55.0] osgi.wiring package; (& Amp; (osgi.wiring.package = org.osgi.framework) (version> = 1.8.0) (! (Version> = 2.0.0))) .

Why Maven-bundle-plugin build this header if I do not have direct dependencies on that package, I also tried to add dependency:

  & lt; Dependency & gt; & Lt; Group & gt; Org.apache.felix & lt; / Group & gt; & Lt; ArtifactId & gt; Org.apache.felix.framework & lt; / ArtifactId> & Lt; Version & gt; 4.6.0 & lt; / Edition & gt; & Lt; / Dependencies & gt;  

and it still uses the version 1.8.0 . Any ideas why?

UPDATE

Checking again, bundles use org.osgi.framework in Activator. But this class comes from the org.osgi.framework.BundleActivator bundle:

  & lt; Dependency & gt; & Lt; Group & gt; Org.osgi & lt; / Group & gt; & Lt; ArtifactId & gt; Org.osgi.core & lt; / ArtifactId> & Lt; Version & gt; 4.3.1 & lt; / Edition & gt; & Lt; Scope & gt; Provided & lt; / Scope & gt; & Lt; Optional & gt; True & lt; / Alternative & gt; & Lt; / Dependencies & gt;  

Then, why not use 1.8 instead of maven-bundle-plugin version 4.3.1 .0 ? And in other bundles this version uses 1.6.2 .

UPDATE 20-3-2015

The exception is I get after mvn pax execution: provision

  org.osgi.framework.BundleException: Bundle unresolved obstacle org.classdomain.per Sistens [47]: unable to resolve 47.0: missing required [47.0] osgi.wiring.package; (& Amp; (osgi.wiring.package = org.osgi.framework) (version & gt; = 1.8.0) (! (Version & gt; = 2.0.0)) Error: Bundle org.classdomain.preistence [47 ] file error launching bundle / org.classdomain.per sistence_0.1.0.jar (org.osgi.framework.BundleException: unsolved obstacle bundled organization. Org.classdomain.preistence [47]: unable to resolve 47.0: Missing Required [47.0] o sgi.wiring Package; (& osgi.wiring.package = org.osgi.framework) (version> = 1.8.0) (! (Versio n> = 2.0.0) ))) .resolveBundleRevision on org.apache.felix.framework.Felix (Felix.java:4002) org.apache.felix.framework.Felix.startBundle (Felix.java:2045) org.apache.felix.framework.Felix. On the organization at setActiveStartLevel (Felix.java:1299) On apache.felix.framework.FrameworkStartLevelImpl.run java.lang.Thread.run (FrameworkStartLevelImpl.java:304) (Thread.java:745)  

Of course, such exceptions only It seems that when using the mvn pax: provision , if I install the same bundles, standing alone in the Felix example, everything works as expected.

Import package descriptions In the case of package versions defined in the libraries you use, These exports (such as org.osgi.framework version 1.8) define in their manifestation have a dependency to org.apache.felix.framework.

If you have only one depenency, then org.osgi

.core 4.3.1 So the package org.osgi.framework should be defined with version 1.6. So this should work.


No comments:

Post a Comment