11

I have a java project that compiles down to an OSGi bundle. I'm using the maven-bundle-plugin to create the bundle, and the maven-sling-plugin to push the bundle to my running OSGi server. At the moment, my project has two dependencies (Guava and Gson) that need to be manually installed in the Felix server prior to installing the bundle. The manual install for these two dependency bundles only needs to occur once (when first setting up the OSGi server), but since it's a manual process, I'd kind of like to just push it into the "mvn install" phase.

I've looked at a number of maven plugins (maven-sling-plugin, maven-ipojo-plugin, dependency plugins, etc.), but I'm afraid that I just don't have enough knowledge to know where to start, or even to search in Stackoverflow for the solution (I have a suspicion that this has already been answered).

So - is there a clean way to install/start dependent bundles with maven? Something where I can specify a jar and a runlevel, and have the installation take place prior to my bundle being installed?

matt
  • 9,113
  • 3
  • 44
  • 46

1 Answers1

6

The Ops4j pax construct project might help: http://team.ops4j.org/wiki/display/paxconstruct/Pax+Construct

Looks like it's possible to use maven to specify which bundles to install and then spin up a felix osgi environment as described here:

http://www.sonatype.com/books/mcookbook/reference/ch01s04.html

Upgradingdave
  • 12,916
  • 10
  • 62
  • 72
  • Thanks Dave - I'll take a look at Pax tomorrow and see what I can find. – matt Apr 09 '12 at 00:08
  • Hi @Dave Paroulek. I'm just getting started with OSGi, but I'm really stuck. Could you please look at my question [**HERE:** Apache Maven Assembly Plugin not working with OSGi bundles](http://stackoverflow.com/questions/34886012/apache-maven-assembly-plugin-not-working-with-osgi-bundles) and see if you could help. I will certainly appreciate any assistance you may be able to offer. Thank you in advance. – Program-Me-Rev Jan 19 '16 at 21:15