You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Stuart McCulloch <mc...@gmail.com> on 2009/12/06 08:17:03 UTC

Re: all non-osgi jars in one bundle

2009/10/14 Gogu Nae <na...@yahoo.com>

> Hello,
>
> I'm tring to buid a bundle that will contain all non-osgi jars in order to
> share it between other bundles.
>
> I've started with one:
>   ....
>   <dependencies>
>     <dependency>
>         <groupId>com.sun.xml.bind</groupId>
>         <artifactId>jaxb-impl</artifactId>
>         <version>2.1.4</version>
>     </dependency>
>     ...
>   </dependencies>
>   <build>
>     <plugins>
>       <plugin>
>         <groupId>org.ops4j</groupId>
>
>  <artifactId>maven-pax-plugin</artifactId>
>         <version>1.4</version>
>         <extensions>true</extensions>
>       </plugin>
>       <plugin>
>         <groupId>org.apache.felix</groupId>
>         <artifactId>maven-bundle-plugin</artifactId>
>         <version>1.4.3</version>
>         <configuration>
>           <instructions>
>             ...
>
>  <Export-Package>*;-split-package:=merge-first</Export-Package>
>             <Import-Package>javax.*</Import-Package>
>             <Embed-Transitive>true</Embed-Transitive>
>             <Embed-Dependency>*;inline=true</Embed-Dependency>
>             <_include>-osgi.bnd</_include>
>           </instructions>
>         </configuration>
>       </plugin>
>     </plugins>
>   </build>
>   ....
>
> When I'm running
> mvn clean org.apache.felix:maven-bundle-plugin:bundleall install
>
> I get this
>
> [INFO]
>  [bundle:bundleall]
> [INFO] Bundling javax.activation:activation:jar:1.1:compile
> [INFO] Bundling javax.xml.stream:stax-api:jar:1.0-2:compile
> [INFO] Bundling javax.xml.bind:jaxb-api:jar:2.1:compile
> [INFO] Bundling com.sun.xml.bind:jaxb-impl:jar:2.1.4:compile
> [INFO] [resources:resources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [pax:compile]
> [INFO] No sources to compile
> [INFO] [resources:testResources]
> [INFO] Using default encoding to copy filtered resources.
> [INFO] [pax:testCompile]
> [INFO] No sources to compile
> [INFO] [surefire:test]
> [INFO] No tests to run.
> [INFO] [bundle:bundle]
> [ERROR] Error building bundle
> com.du.lib.bundle:du-lib-bundle:bundle:1.0.0-SNAPS
> HOT : Unresolved references to [com.sun.xml.fastinfoset.sax,
> com.sun.xml.fastinf
> oset.stax, org.jvnet.fastinfoset, org.jvnet.staxex, org.w3c.dom,
> org.xml.sax, or
> g.xml.sax.ext, org.xml.sax.helpers] by class(es) on the
>  Bundle-Classpath[Jar:dot
> ]: [com/sun/xml/bind/v2/runtime/unmarshaller/UnmarshallerImpl.class, ...]
>
> How can I force the plugin to go deeper and get me the other dependencies
> too from the maven repository?
>

firstly try the latest version of the plugin (2.0.1) because it handles the
various dependency scopes better

secondly if you're using a transitive Embed-Dependency then you should just
need to use bundle:bundle

the bundleall goal is a specialized goal that attempts to wrap each
dependency up as a bundle using
heuristics (export all content, etc.) and doesn't perform any embedding,
etc. - with bundleall you'll get
a lot of small bundles, whereas with a transitive Embed-Dependency you
should get one big bundle.


> Thank you
>

-- 
Cheers, Stuart