Export an OSGI application from Eclipse

I developed an osgi application (without rcp) using eclipse. It consists of several plug-ins-project-packages and dependencies from the eclipse plug-ins folder (commons. * ...)

The app works great when launched using eclipse.

What is the best way to export and deploy such an application from eclipse? Is there an easy way to export my startup configuration?

All I found was for rcp projects.

+6
java eclipse export deployment osgi
source share
5 answers

Check out Chapter 9 on packaging OSGi / Equinox apps in the new OSGi and Equinox book. It is now available with a rough cut: http://my.safaribooksonline.com/9780321561510 . It should be available for printing at EclipseCon in March.

+1
source share

All you have to do is religiously fill out your Manifest.MF through the PDE (plugin editor), you should

  • Add the correct plugin dependencies in the Dependecies tab in PDE
  • Fill the class path and exported packages in the Runtime tab.
  • And most importantly, make sure that on the Assembly tab, which you checked, on the required resources that you want to export.

It is very important to note point 3 , this is where most people make mistakes and wonder why the project works fine in Eclipse, but when you run doest, it starts when exported.

Right-click on your project-> Export-> Plugin-Development-> Deployable Plugins and Snippets

+2
source share

Creating an OSGi package is not in itself a complete application. OSGi packages require a container and its responsibility for the container to control the lifetime of the package: loading the package, resolving dependencies, invoking the bundle activator, etc. There are several OSGi containers, such as Knopflerfish ( http://www.knopflerfish.org/ ), Felix ( http://felix.apache.org/ ), and Equinox ( http://www.eclipse.org/equinox/ ) . Inside Eclipse uses Equinox.

Deploying an application using OSGi entails configuring the container, and the exact mechanism for this depends on the container selected. If you want to continue using Equinox, check out this quick start guide to configure and run the container outside of Eclipse ( http://www.eclipse.org/equinox/documents/quickstart.php ).

+1
source share

The PDE generates a configuration that can be configured much easier than writing an Equinox configuration from scratch. In your Eclipse-based OSGi environment, enter pools. You will see where Equinox places all the runtime packages to run. It should have config.ini, which the PDE generates to run. In my case, this is [the root of the workspace] /. Metadata / .plugins / org.eclipse.pde.core / [My Launch Config Name] /config.ini.

0
source share

-> Creating a function project in Eclipse

enter image description here
-> Open the feature.xml file of the created project.
-> Add all the necessary plugins and dependencies in the "Included plugins" section
enter image description here
-> Make sure you add all OSGI-dependent "plugins"
Here is the list of plugins I use

enter image description here

-> Now create an OSGI startup configuration
enter image description here
-> In the "Bundles" section, select your project. enter image description here

Now all plugins can be exported from the Overview tab of your function. xml

0
source share

All Articles