Apache Felix Karaf in Eclipse PDE

Apache Felix Karaf is an OSGi based application framework that is the core for the Apache ServiceMix projects. I use Eclipse for my Java developement and wanted to have the benefits of development in the Eclipse PDE with the Karaf platform features (hot deploy, GShell based console among other things).

This little project service two purposes: I get to learn about Eclipse plugin development and I get Apache Felix Karaf running in PDE!

I have a first version working with the following features:

  •  My Eclipse plugin builds are based on the Karaf Maven artifacts and require no changes to Karaf
  •  An Eclipse Target Platform definition plugin is created with the exact system bundles as in Karaf (including both Felix and Equinox OSGi frameworks)
  •  Configuration is done using native Karaf configuration files -- no special  magic is used
  • Launching is done via the org.apache.felix.karaf.main.Main class
  • The boot classpath is the same during the Eclipse launch as is the set of packages exported by the system which keeps the development and deployment environments in sync. You'll appreciate this if you have done any significant OSGi development.


Things that are left to do:

  • Provide a Karaf specific tab to make it easy to configure common Karaf options
  • Easy access for starting the Remote Console along with the port to listen on
  • Easy access for starting the Local Console
  • Pull in more features for NMR and ServiceMix support so that a features profile can be selected
      

Here are some screenshots to get you started:

 

Apache Felix Karaf Eclipse Launch configuration
Apache Felix Karaf running in Eclipse PDE with the console showing

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

How can we setup Karaf in eclipse ?

Hi Stephen,

I would like to thank you for your initiative. By the way, I don't see anything in your blog message explaning How to setup this in Eclipse ! Can you provide more info please ?

Regards

Charles Moulliard

Apache Camel Committer

Setup in Eclipse

Hi Charles,

I am about to release an update that fixes a critical bug as well as adds support for Eclipse running on Java 1.5.

Using Karaf in Eclipse involves two steps:

  1. Set the Eclipse Target Platform to Apache Felix Karaf
  2. Create an Apache Felix Karaf launch configuration

From there you add / remove bundles in your workspace, install features in the Karaf CLI, you can also add more bundles by manipulating the target platform.

Since this is a very early release the workflow is a bit rough. I would like to make things much easier -- I have a very long list of things to do.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.