Maven repository to OSGi Bundle Repository

Recently, I’ve had the chance to start to work with OSGi. One of the first things that I faces was how I can prepare a local Maven repository as a local OSGi Bundle Repository (OBR). The central concept is to maintain a repository.xml as the OBR descriptor. There are several ways to do so including manually doing it. I just found out that Apache Felix has a Maven plugin called maven-bundle-plugin. In the latest version of this plugin, there is a goal bundle:index. On a project configured with you Maven repository, first configure this plugin and then run:

[plain]
mvn bundle:index
[/plain]

This will generate a repository.xml at the root of your Maven repository. Then you can use that to feed the OSGi container that you use for bundle provisioning.

2 responses to “Maven repository to OSGi Bundle Repository”

  1. Mehran says:

    Have you tried Tycho and p2 repositories?

  2. بهروز نوبخت Behrooz Nobakht says:

    It seems a good idea, but fits if you’re biased towards using Virgo/Equinox/Gyrex OSGi mixture, right?

Leave a Reply

Your email address will not be published. Required fields are marked *