cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gustavo Morozowski" <>
Subject Re: osgi bundles
Date Wed, 18 Jul 2007 22:51:04 GMT
I've checked with the jetty project, from version 6.1.5 onward they jars
will be OSGi "enabled", and they are using the same maven plugin I talked
about. And Spring-OSGi is also using it, so I think it's a good start :)

The first step is to use the plugin to generate the manifests. I modified
the pom.xml from the rt/core to include:


This is the package specifier to create osgi manifests.

- <#> <plugin>
 - <#>       <configuration>
 - <#>           <instructions>

Here I am telling the plugin that all packages are private to the jar. So
the resulting manifest is:

Manifest-Version: 1
Bundle-Vendor: Apache Software Foundation
Private-Package: META-INF.cxf,,org.apache.cxf,
Bundle-Version: 1.0.0
Bundle-Name: Apache CXF Runtime Core
Created-By: Bnd-0.0.106
Bundle-ManifestVersion: 2
Include-Resource: src/main/resources/
Bundle-SymbolicName: org.apache.cxf.cxf-rt-core

The important sessions here are Private-Package, Import-Package and
Export-Package (not seen in this example). In OSGi dependency is specified
in package level, so Import-Package declares the needed packages to import
and is automatically created by the plugin.

The Export-Package lists the packages exported by the jar to other packages.
It's important to understand that the osgi runtime enforces this visibility,
so even if you declare public classes inside a jar they will not be seen to
other jars unless they are exported. The Private-Package is the opposite.

So the first step will be to write this definitions. At first I will export
all packages and see how it works. As I am not a maven guru I would need
some advice which pom.xml put the necessary <repository> and
<pluginRepositories> sections needed by the plugin (probably in the root

I would like to point to more detailed references:

Bundle Plugin for Maven:

Bnd tool this plugin is based:

Sample use of this tool to wrap hibernate as osgi bundle:

Getting Started with OSGi series:<>


On 7/12/07, Oisin Hurley <> wrote:
> > I see that there's a open ticket (
> > for creating OSGi
> > bundles. I
> > have made a small experiment to include the maven bundle plugin (
> > in the
> > runtime
> > core jar to gererate osgi compatible manifests. If there is
> > interest I could
> > give more details and help with this ticket.
> Definitely some interest from me, Gustavo, let's have some more
> details :)
>   cheers
>    --oh
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland

View raw message