views:

308

answers:

4

I've developed an osgi application (no rcp) using eclipse. It consists of several Plugin-Projects-Bundles and dependencies from eclipse plugins folder (commons.* ...)

The application works fine when launched using eclipse.

What is the best way to export and deploy such an application from eclipse? Is there a simple way to export my launch configuration?

All I found was for rcp projects.

A: 

All you need to do is religiously fill your Manifest.MF via PDE(Plugin Editor), you must

  1. Add proper plugin-dependencies in the Dependecies tab in PDE
  2. Fill the Classpath and Exported Packages in the Runtime tab
  3. And most importantly, make sure in the Build tab you have checked on the required resources to be exported.

Its very important to note point 3, it is here where most people make mistake and wonder why the project is running perfectly in Eclipse but doesent run when exported.

Right-Click on your project->Export->Plugin-Development->Deployable Plugins and Fragments

Suraj Chandran
This is almost what I'd like to get but the launcher and configuration is missing.
Wienczny
A: 

Creating an OSGi bundle, by itself, does not constitute a complete application. OSGi bundles require a container and its the container's responsibility to manage the lifetime of the bundle: loading the bundle, resolving dependencies, invoking the bundle's activator, etc. There are several OSGi containers available such as Knopflerfish (http://www.knopflerfish.org/), Felix (http://felix.apache.org/), and Equinox (http://www.eclipse.org/equinox/). Internally, Eclipse uses Equinox.

Deploying an application that uses OSGi entails configuring the container and the exact mechanism for doing that depends on the chosen container. If you wish to continue using Equinox then check out this quick-start guide for configuring and launching the container outside Eclipse (http://www.eclipse.org/equinox/documents/quickstart.php).

Faron
I just had hoped that there was something like the "Product Configuration"-Project for OSGI instead of RCP.Felix is not an option as it currently has a bug that prevents some bundles from working, so I will stick with equinox. I just don't get equinox working. Because Eclipse launches the application there could have been some export for the launch configuration...
Wienczny
+1  A: 

Check out Chapter 9 on packaging OSGi/Equinox applications in the new OSGi and Equinox book. It's available on rough cuts now: http://my.safaribooksonline.com/9780321561510. It should be available in print for purchase by EclipseCon in March.

James Branigan
A: 

PDE generates a configuration that can be customized much easier that writing an Equinox config from scratch. In your running Eclipse-based OSGi environment, type bundles. You'll see where Equinox is putting all the runtime bundles for the launch. In there should be a config.ini that PDE is generating for the launch. In my case it's [workspace root]/.metadata/.plugins/org.eclipse.pde.core/[My Launch Config Name]/config.ini.

Ken Gilmer