Maven and OSGi Roundup

A number of links concerning Maven and OSGi. Also see the Java Modularity Tutorials (OSGi, Declarative Services and Maven).

Maven + NetBeans

Maven Best Practices for NetBeans For instance, link Maven goals with IDE actions (so you can right-click the project and „Run on Felix“
NetBeans Quick Start using Maven Shows how a NetBeans Platform application can be created using Maven
An overview of many advantages using Maven with NetBeans offers

OSGi + Maven + NetBeans

Creating OSGi Bundles and Deploying them to GlassFish (Creates the OSGi bundles stand alone and then directly deploys to the server)
Creating a simple web application where one module consumes a service from the second Part 1 Part 2

OSGi + NetBeans

NetBeans Platform Quick Start Using OSGi (Shows how a OSGi container can be created – based on a sample Felix/Equinox application)
Overview of the approach taken by NetBeans to integrate with OSGi
Create OSGi Bundles and Project in Maven and Maven NetBeansModule with NetBeans support

OSGi + Maven + eclipse

Use eclipse plugin project for Maven projects (!!!)
Presentation giving a good overview (but 2 years old)
Best practices from a project experience (Part 1, Part 2, Part 3, Part 4)


OSGi Services Creating these OSGi services without Spring

OSGi + Spring

Spring Dynamic Modules for OSGi Spring framework to make the calls to OSGi services clearer (remove them from the classes code)
Modular Java Book (Walls, 2009)

OSGi + Declarative Services

Good overview presentation with nice illustrations
Apache Example using XML files
Declare OSGi Services with annotations (using apache flex maven scr plugin) Example
Slides Good Overview of Services in OSGi and details regarding Maven SCR
Felix Distribution Download
(iPojo, Eclipse extensions and Spring DM are alternatives to declarative services) – slides describing the different approaches
more alternatives: Peaberry (Google Guice), Blueprint Service (Spring DM in OSGi standard)
Howto OSGi Declarative Services (German)
Mail List discussion about the differences between Declarative Services in Felix and Equinox

OSGi + Declarative Services + Felix SCR

A 7 part series on using Services in Felix using SCR
Maven SCR PLugin to generate XML files from Java/JavaDoc Annotations (Official documentation)
Apache Felix SCR Plugin Introduction
Tips on configuring declarative services correctly using Felix SCR
Few Examples of Using the Maven SCR Annotations

OSGi + Declarative Services + eclipse

Declarative Services Using Eclipse

OSGi + Maven

Another Example of Using Declarative Services using GlassFish
The Bundle Plugin for Maven
Creating an OSGi Project with Maven

OSGi Alternatives

Surely there are the NetBeans Modules. As part of JDK 6, the ServiceLoader class can be used. However, to my understanding, this class does not allow for different versions of JAR files in the classpath and is not as dynamic as OSGi.

Use ServiceLoader with annotations
Discussion of ServiceLoader/OSGi differences
Discussion of Differences Between NetBeans Modules and ServiceLoader

OSGi + Swing

Example of Application which integrates Swing and OSGi
My question on Maven and OSGi in NetBeans


Example GWT Application in a OSGi bundle

3 thoughts on “Maven and OSGi Roundup

  1. I wrote a tool called auto-builder. It introspects PDE-based projects and generates Ant build files; it supports transitive closure over dependencies and all that jazz.

    I posted a write-up here. I wrote it because the Maven tools I played with, when integrated with PDE, didn’t “just work.” Basically, I wanted to do coding in PDE and have a Hudson-based CI without any fuss in between.

    Generating Ant files is nice because it gives you all the benefits of a declarative build tool, but it leaves you with a procedural description of what it is doing.

    I am looking for more PDE-based projects to test it on. There are a couple RFC-0112 Bundle repositories around, and I have some code for downloading dependencies. If anyone is interested, then I could integrate dependencies download with auto-builder.

    1. Thanks James! Looks interesting. I think you are very right about the shortcomings of the tools to allow you to work with OSGi + Maven + eclipse. I currently use the Maven Eclipse Plugin in combination with the Maven Bundle Plugin (but the configuration is a bit tricky and far from ‘just working’).

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s