Tuesday, July 21, 2009

Exporting an OSGi application from Eclipse

Sometimes working with Eclipse feels like arcane science.
Creating a pure OSGi (Equinox) application is as easy as it can get.
Running and tuning are dead simple. Manipulating the runlevels works like a charm (needed to get load time weaving integrated).
But then try exporting it.
After a little painful research and some nice hints from the newgroup I got the following process:
  1. Create a product from your launch config.
  2. Open the product and go the configuration-tab. You will only see the bundles that were designated to be auto-started at a certain level. Add all other bundles and set them to auto-start at level 4. The funny thing here is that these are the default settings for every OSGi-Framework application, but in a product the default is to not auto start anything.
  3. Now make sure that all fields on the overview-tab are blank (Application has always a preselection, at least on my install)
  4.  If you haven't done so before add org.eclipse.simpleconfigurator to be started in level 1.
  5. Start the Export Wizard.
  6. Make sure that "Synchronize before exporting" is UNSELECTED, otherwise the export will fail.
  7. Export.
  8. If you don't have the delta in your target platform you will now have to copy the native fragments into the export.
There you go.


No comments: