Hi Petra,

According to maven-bundle documentation:

"<Export-Package> is now assumed to be the set of packages in your local
Java sources, excluding the default package '.' and any packages containing
'impl' or 'internal'."

This is the default. That is, by default the exported packages will be all
packages in your _source_ and that excludes any library/dependency. If you
want to export everything than add a Export-Package tag to your pom.

<plugin>
   <groupId>org.apache.felix</groupId>
   <artifactId>maven-bundle-plugin</artifactId>
   <version>2.3.5</version>
   <extensions>true</extensions>
   <configuration>
       <manifestLocation>META-INF</manifestLocation>
       <instructions>
           *<Export-Package>*</Export-Package>*
           <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
           <Embed-Transitive>true</Embed-Transitive>
       </instructions>
       <archive>
           <addMavenDescriptor>false</addMavenDescriptor>
       </archive>
   </configuration>
</plugin>

I'm not going to tell you wether this is a good idea or not (brighter people
on this list might) but my personal preference would be to OSGi-ify the
libraries instead and install them as normal bundles into your container
(Felix i guess). This is to avoid "I'm building a monolithic application"
that you're trying to solve with OSGi in the first place. For example, say
that one of your other bundles need one of the libraries that you export but
with a newer version. To deal with that, you need to repackage your
monolithic bundle and deploy it, possibly affecting alot of other bundles
depending on other library packages embeded in your bundle. If the library
was a bundle itself, only bundles actually dependent on things in that
bundle would be affected by updates, stops and uninstalls.

Generally, when modularizing, you don't want to clump existing modules
together. That kind of defeats the purpose. :)

Hope this helps!

Regards,
Per-Erik Svensson

On Sun, Aug 14, 2011 at 11:55 PM, Petra Staub <cal...@hotmail.com> wrote:

>
>
>
>
>
> Hi all
>
> Is it possible to create with maven-bundle-plugin nested bundles, thus a
> bundle holding a bunch of other bundles?
> I tried to specify the dependencies in my pom.xml and create a bundle with
> following config:
>
> <plugin>
>    <groupId>org.apache.felix</groupId>
>    <artifactId>maven-bundle-plugin</artifactId>
>    <version>2.3.5</version>
>    <extensions>true</extensions>
>    <configuration>
>        <manifestLocation>META-INF</manifestLocation>
>        <instructions>
>            <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
>            <Embed-Transitive>true</Embed-Transitive>
>        </instructions>
>        <archive>
>            <addMavenDescriptor>false</addMavenDescriptor>
>        </archive>
>    </configuration>
> </plugin>
>
> Unfortunately the resulting MANIFEST.MF never contains the Export-Package
> declaration for the included bundle jars.
>
> Thanks,
> petra
>
>
>
>

Reply via email to