You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by David Bosschaert <da...@gmail.com> on 2008/10/09 10:35:08 UTC

[maven-bundle-plugin] Flattening multiple bundles into a single one

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?

Thanks in advance,

David

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: [maven-bundle-plugin] Flattening multiple bundles into a single one

Posted by Stuart McCulloch <mc...@gmail.com>.
2008/10/9 David Bosschaert <da...@gmail.com>

> 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: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>


-- 
Cheers, Stuart