2008/10/9 David Bosschaert <[EMAIL PROTECTED]> > Hi All, > > In OSGi you always need to decide what the best level of granularity > is for your bundles. On the one hand, fine grained bundles with > dependencies are generally better (IMHO) but sometimes a single bundle > that contains all your dependencies can be convenient, especially when > you want to get started with something, as you only need to install > that single bundle. > > For the project that I'm currently working on, the RFC 119 Distributed > OSGi DSW Reference Implementation > (http://svn.apache.org/repos/asf/cxf/sandbox/dosgi), I'm planning to > provide both approaches as built artefacts - so people can choose. > Currently I have the fine-grained approach with a number of bundles. > I was wondering can the maven-bundle-plugin easily flatten all the > bundles for me and create a single bundle that contains all > dependencies? If so what would be the best way to do this? >
the easiest way would be to create a new (mega-)bundle project with the fine-grained bundles listed as dependencies, then use the Embed-Dependency feature with inline enabled, such as: <Embed-Dependency>*;scope=compile;inline=true</Embed-Dependency> then you just need to decide which packages to export: <_exportcontents>org.foo.bar, org.etc</_exportcontents> don't use Export-Package unless you want to pull in some other classes from the classpath, because you're already including the dependency classes via the embed instruction... you can find lots more detail and examples here: http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html#ApacheFelixMavenBundlePlugin(BND)-Embeddingdependencies http://felix.apache.org/site/apache-felix-bundle-plugin-faq.html HTH > Thanks in advance, > > David > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Cheers, Stuart

