LibraryToggle FramesPrintFeedback

There are a number of tools available and the different OSGi containers use varying deployment mechanisms. However, the basic steps to package and deploy applications into an OSGi container are the same:

Once your bundles are installed, you can start and stop them using the container's commands. You can also upgrade them in place when needed.

You can hand edit the manifest files for each of your application's bundles and manually assemble them using the standard Java mechanism for creating JARs. Hand editing a manifest is a tedious and error prone process and is not recommended. You should use one of the many tools available for creating OSGi bundles.

The bnd tool from Peter Kriens is powerful and freely available. It automates the construction of OSGi bundle manifests by introspecting the contents of the classes being packaged in the bundle. Using the knowledge of the classes contained in the bundle, the tool can calculate the proper values to populate the Import-Packages and the Export-Package properties in the bundle manifest.

The bnd tool can be used as an Ant task and is the foundation for the Maven bundle plug-in from Apache Felix.

Comments powered by Disqus
loading table of contents...