On Wed, Sep 2, 2009 at 8:35 AM, Stuart McCulloch <[email protected]> wrote:
> 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> > Here's an interesting bit. If I use the pattern com.foo.* it doesn't seem to do anything except get rid of the warning message; all the contents of the embedded jar gets pulled in. If I use the pattern com.foo.pvt, the packages that are split, everything seems to work perfectly. Thanks for all your help. - Dmitri
