Wrap Java Libraries as OSGi Bundles with Maven

If a 3rd party library isn't supplied as an OSGi bundle you need to do some extra steps as OSGi developer.

In this example we are wrapping the following libraries from the Spring Data ecosystem:

The parent project uses Tycho.

Tycho - Building Eclipse plug-ins with maven

We started from the eclipse/tycho-demo and developed our pom-first Maven build for wrapping the 3rd-party libraries.

The demo utilizes Apache Felix Maven Bundle Plugin (BND).

Step 1: Declare your dependency to the plain library:


Step 2: Tune the OSGi bundle generation via the following configuration:


In a future post, we'll flesh out the example and show how to use Spring Data JDBC in an OSGi environment. Stay tuned...

Header cover Photo by Ms Jemini