Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a complete OSGi application with Felix & Maven

I have a set of OSGi bundles being built using Maven and I was wondering if there is a Maven plugin available that allows me to do the following:

  1. Specify the set of bundles to include in a distribution and/or specify a single bundle and have the dependencies resolved.
  2. Build a complete distribution of the framework. What I mean is a single zip file containing all the bundles needed, plus the correct directory structure for felix so that the user can simply unzip the file and type "java -jar bin/felix.jar".

I did some Googling and I didn't find anything very promising aside from appassembler. Have any of you ever come up with a good solution?

Update Here's an illustration of what I'm trying to accomplish.

example-parent\
               bundle-one
               bundle-two
               bundle-three
               assembly-one
               assembly-two

Where assembly-one would include bundle-one and bundle-two and assembly-two would include bundle-two and bundle-three or any combination thereof. Then when you build your project, you would get two zip files, one for assembly-one and one for assembly-two that would contain the appropriate bundles in a self-contained felix install. For example:

assembly-one.zip\
                 bin\felix.jar
                 bundle\bundle-one, bundle-two, plus bare min felix bundles
                 conf\any configuration files I need

Hopefully that provides a little more information about what I'm trying to accomplish. I guess this is kind of similar to how Eclipse does a feature.xml, but of course not using Eclipse.

like image 922
babernathy Avatar asked Feb 16 '12 18:02

babernathy


1 Answers

The Sling Launchpad Plugin [1] creates a runnable jar file or a war file that embeds the OSGi framework and a customizable list of bundles, that's probably what you need. With that you don't even have to unpack the generated jar file, just starting it is sufficient.

[1] http://sling.apache.org/site/maven-launchpad-plugin.html

like image 71
Bertrand Delacretaz Avatar answered Oct 22 '22 13:10

Bertrand Delacretaz