Skip to content
mbarchfe edited this page Sep 14, 2010 · 20 revisions

Overview

This example is based on Christian’s OSGi sample application, which was used in the OSGi Workshop as a reference. This fork includes everything that is needed to build the application from command line ANT with the PDE Build and pluginbuilder.

Let’s get started with downloading and extracting the example from github, http://github.com/mbarchfe/osgi-kasse-example. You can either check it out with git or download a zip file.

In the following it is assumed that the example has been extracted to ${example.home}

Getting all the dependent bundles

It is not part of this build to fetch the dependent bundles, so we prepare a directory with all the bundles and the Eclipse installation needed to run the PDE Build beforehand.

Christian has prepared a pom.xml which retrieves the target platform via maven. For this build we want to install the application after the build into an Eclipse test host for running integration tests. Therefore we remove the org.eclipse.* bundles from Christians target platform and let the build pick these bundles from the Eclipse tests host instead. Otherwise we run into version conflicts. In addition we need the delta-pack for creating a native launcher.

$ cd ${example.home}/osgi-plattform
$ mvn package
$ rm target/org.eclipse.*
$ unzip eclipse-3.5.2-delta-pack.zip -d eclipse-3.5.2-delta-pack
$ tar xzf eclipse-SDK-3.5.2-macosx-cocoa-x86_64.tar.gz

Some Notes on Version Control System

In this example however the sources are not checked in to CVS or Subversion, the VCS supported from pluginbuilder/PDE. One way to add arbitrary VCS is to check out/export your code from the VCS into a local directory and then then copy the sources from that place into the build directory. PDE supports this with the COPY method in map files.

Run the build from Eclipse

The PDE build can be started from the command line via ant and can therefore be run on any server. To bootstrap the build just check out the org.osgiusers.germany.example.kasse.pluginbuilder and run ant in that folder. All local dependencies are found in the build_local.properties file. For any build-server you can create a file with the specific settings for that server. For this example however we have to modify the map files, too, see above.

Christian has created a video how to set up an Eclipse workspace with the example. You can follow his description and then add the eclipse directory to the target platform as follows

  • ${example.home}/osgi-plattform/target
  • ${example.home}/osgi-plattform/eclipse

In order to tweak the map file with a text editor or alternatively you can install pluginbuilder and let it do the work, http://self.pluginbuilder.org/nightly/p2-updateSite.

Clone this wiki locally