Installing OSGi dependencies with maven-bundle-plugin
Asked Answered
C

1

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?

Crackbrained answered 6/4, 2012 at 15:56 Comment(0)
P
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

Phosphocreatine answered 8/4, 2012 at 21:59 Comment(2)
Thanks Dave - I'll take a look at Pax tomorrow and see what I can find.Crackbrained
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 and see if you could help. I will certainly appreciate any assistance you may be able to offer. Thank you in advance.Autography

© 2022 - 2024 — McMap. All rights reserved.