Export and mavenize bundle

Post Reply
Posts: 11
Joined: Thu Mar 19, 2015 2:16 pm

Export and mavenize bundle

Post by Alizee » Fri Mar 27, 2015 7:29 pm

Hey again, I would like to export a bundle/plug-in for the odysseus-server that I've created, in a way that allows me to build it via console (probably maven) and install+start it inside the standalone odysseus server osgi command line. Is it possible to automatically build a proper pom.xml and/or what is the fastest way to get those things done?

PS: How much effort would it take to run odysseus inside a different osgi-container (for instance Karaf)?

Thanks in advance and enjoy your weekend,


User avatar
Posts: 35
Joined: Tue Jul 29, 2014 10:55 am
Location: Shanghai, P.R. China/中国上海

Re: Export and mavenize bundle

Post by ckuka » Mon Mar 30, 2015 7:00 am

I think the easiest way is to export the server and core bundle and install them in Maven:
mvn install:install-file -Dfile=<path-to-file> -DgroupId=de.uniol.inf.is.odysseus -DartifactId=core -Dversion=1.0.0 -Dpackaging=jar

Now, you should be able to build your own bundles using Maven (if the bundle only depends on odysseus server and core). If you have other dependencies, you will need to import them to Maven accordingly. (And yes, I know this is not the convinient way :shock: )

To include your bundles in Odysseus again, you will have to either import the Maven project in Eclipse and insert it into the project definition as an additional dependency or, if you already exported a project as a runable project, you can copy the file into the "plugins" folder and set an entry in configuration/org.eclipse.equinox.simpleconfigurator/bundles.info file.

(By the way, if you know of any simple way to transform an Eclipse project into a Maven project with all the OSGi and GUI specific parts of Eclipse, please feel free share them with me)
kind regards / 祝好
Christian Kuka

Posts: 8
Joined: Thu Aug 06, 2015 9:05 am

Re: Export and mavenize bundle

Post by jwe » Tue Aug 11, 2015 9:01 am

Hi guys,

I know my answer is a bit late, but as far as I know, Eclipse+M2e provides the way to mavenize projects. Right click on your plugin project->maven->convert to maven project.

The tricky parts are (Odysseus itself has got lots of projects to convert):

- mavenizing using eclipse -> you wont get the directory layout (src/main/java,...). Directory structure will be unchanged as src/... (you have to change it on your own to src/main/java,...)
- you have to define bnd in your pom.xml to build bundles with required osgi headers
- define import/export manually

To run Odysseus in an osgi contrainer, just use projects of osgi pax, like pax runner, pax provision... It's worth to think about it, but a lot of work.

greetings jwe

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest