7

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.

Wienczny
  • 3,348
  • 4
  • 27
  • 35

5 Answers5

2

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
  • 23,444
  • 11
  • 58
  • 92
1

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
  • 1,257
  • 9
  • 19
  • 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 Feb 09 '10 at 21:27
1

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
  • 1,164
  • 7
  • 9
0

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.

  • The configuration generated by eclipse points to eclipse projects. When you export your osgi bundles, it generates jars. So the configuration generated can't be used with no changes. – John John Pichler Jun 12 '11 at 17:47
0

-> Create a feature project in Eclipse

enter image description here
-> Open feature.xml file of the created project.
-> Add all the required Plug-ins and dependencies under "Included Plug-ins"
enter image description here
-> Ensure that you have added all OSGI dependant "Plug-ins"
Here is a list of Plug-in I am using

enter image description here

-> Now create the OSGI run configuration
enter image description here
-> Under "Bundles", select your feature project. enter image description here

Now all the plug-ins can be exported from the Overview tab of your feature.xml

jafarmlp
  • 1,049
  • 12
  • 11