2009/9/2 Dmitri Plavjanich <[email protected]> > On Wed, Sep 2, 2009 at 8:12 AM, Stuart McCulloch <[email protected]> > wrote: > > > 2009/9/2 Dmitri Plavjanich <[email protected]> > > > > > The contents of the embedded jar still gets duplicated inside the > bundle. > > > > > > > what exactly are the contents of support-jar? does it contain any > > com.foo... > > packages? > > > > Yes, there are package overlaps. > > > > because by saying: > > > > <Private-Package>com.foo.*</Private-Package> > > > > you're telling Bnd to pull in all classes/resources from any matching > > packages and inline them > > > > if you only want to inline your compiled source and the packages overlap > > with the dependency, > > then either explicitly list the packages (ie. no wildcard that matches > the > > dependency contents) > > > > That might not work because of the overlap, i.e. both the bundle and > embedded jar have the same packages. > > > > or if you're using the 2.0.0 plugin simply don't include Private-Package > at > > all and it will calculate > > it based on your local source files. > > > > In this case it still pulls in the embedded jar's files; all of them. >
if your packages fully overlap (ie. com.foo.wibble exists in both the source and the dependency) then yes, by default it will pull in both the compiled source and the classes from "support-jar" so that your bundle contains a consistent class-space. you should have also received a warning about "split-packages" (which are a bad thing usually) in this case to stop Bnd from pulling in the dependency classes you need to add the following: <Private-Package>com.foo.*;-split-package:=first</Private-Package> see http://www.aqute.biz/Code/Bnd for more details about split packages > - Dmitri > > > > > > <build> > > > <plugins> > > > <plugin> > > > <groupId>org.apache.felix</groupId> > > > <artifactId>maven-bundle-plugin</artifactId> > > > <extensions>true</extensions> > > > <configuration> > > > <instructions> > > > > > > <Embed-Dependency>support-jar;inline=false</Embed-Dependency> > > > <Export-Package>com.foo.api</Export-Package> > > > <Private-Package>com.foo.*</Private-Package> > > > > > > <Bundle-Activator>com.foo.impl.Activator</Bundle-Activator> > > > </instructions> > > > </configuration> > > > </plugin> > > > </plugins> > > > </build> > > > > > > <dependencies> > > > > > > <dependency> > > > <groupId>org.papoose.osgi</groupId> > > > <artifactId>OSGi_R4_v4.1_core_spec</artifactId> > > > <scope>provided</scope> > > > </dependency> > > > > > > <dependency> > > > <groupId>com.foo</groupId> > > > <artifactId>support-jar</artifactId> > > > <scope>runtime</scope> > > > </dependency> > > > > > > </dependencies> > > > > > > - Dimitri > > > > > > > > > > > -- > > Cheers, Stuart > > > -- Cheers, Stuart
