7. Developing OSGi Bundles using Plug-in Development Environment (PDE)

This chapter assumes that the user is already familiar with the Plug-in Development Environment (PDE). Should this not be the case it is recommended to read first the PDE documentation or one of the many tutorials available online.

7.1 Resolving Bundle Dependencies

Starting from release 1.5.0 the Tools support developing OSGi Bundles using the widely popular Eclipse Plug-in Development Environment (PDE).

While working with OSGi bundles, one of the most important aspects is defining the required dependencies in the MANIFEST.MF file. When used in conjunction with the PDE, the Virgo Tools address this problem by leveraging on the PDE tooling and in particular on the PDE Target Platform Definition. A Target Platform Definition defines the bundles which your workspace will be built against.

At runtime however, a PDE Target Platform won't be available and dependency resolution will always occur against the bundle repositories configured for the Virgo Runtime Environment. The Tools try to bridge runtime and development by providing a Server wizard that creates a new PDE Target Platform Definition that matches the Server repository configuration, as defined in org.eclipse.virgo.repository.properties .

The Virgo Runtime Environment supports watched, external and remote repositories. Watched and external repositories correspond to file system folders, while a remote repository is a remote Virgo instance that can serve its repository content to other Virgo instances for the purpose of dependency resolution. The PDE Target Platform allows its content to be specified only as file system folders or P2 Update sites. As such, when the Tools create a PDE Target Platform Definition from the runtime repository configuration only watched and external repositories are considered.

Developers should properly setup a local Virgo Runtime Environment so that its bundle repositories contain their application dependencies. Then they should use the Tools to setup a PDE Target Platform so that their workspace projects are built and resolved against the same bundles that will be available at runtime.

Note that when using the Tools together with PDE to develop for Virgo it's not possible to use the MANIFEST.MF headers Import-Bundle (not part of the standard OSGi specification but supported by Virgo) and Require-Bundle (part of the standard OSGi specification but not supported by Virgo). Developers will have to declare all of their external dependencies using the Import-Package header only.