OSGi Runtime Comparison: Eclipse Virgo vs Apache Karaf

I’ve been working for a while on deploying web applications onto an OSGi Runtime. Initially, we had Eclipse Virgo and Apache Karaf as the options. It’s not yet final but I thought maybe it would be nice to post some general comparison in this regard. It also fascinates me that although there are several works on OSGi Runtime/Server, but also in a way or another quite all of them end up in an dependency on or using Apache Felix Framework.

An overview of different OSGi Container Features

Shell FrameworkLogging APIInstance SupportHot DeploymentDynamic ConfigurationProvisioningWeb ContainerAdmin ConsoleOSGi Framework SupportedOSGi Container Runtime
Apache Felix GoGoLogBack?Yes?YesJetty /// Apache Tomcat /// Web Integration Layer (Java EE)YesEclipse EquinoxEclipse Virgo
Apache Felix GoGoLog4J, SLF4J, JCL, etcYesYesYesYesJettyYesEclipse Equinox ///
Apache Felix
Apache Karaf

I shall update the post with more results especially on Eclipse Gyrex if I can grab the time.

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:

mvn bundle:index

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.