Wednesday, May 27, 2009

Updates to Karaf in Eclipse PDE

Just a quick update to running Apache Felix Karaf in Eclipse PDE: I now have it launching Karaf with proper configuration synchronization. This means that there are no longer any exceptions during startup due to missing configuration files and the files are only synchronized if they are missing.

Developers can freely modify the default configuration files or provide their own entirely and the launcher will preserve those changes between executions.

I am one step closer to having this working well enough to develop against. The remaining tasks:

  • Synchronize workspace and additional Target Platform bundles to the configuration
  • Add a proper source bundle to the Target Platform definition for Karaf
  • Create the Karaf specific property pages to make configuring things easier

Here's a screenshot:


Tuesday, May 26, 2009

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.