Over a million developers have joined DZone.

Creating OSGi projects using Eclipse IDE and Maven

DZone's Guide to

Creating OSGi projects using Eclipse IDE and Maven

· Java Zone
Free Resource

Learn how to troubleshoot and diagnose some of the most common performance issues in Java today. Brought to you in partnership with AppDynamics.

f you want to create any of these projects listed below using Eclipse IDE,

OSGi Application Project
OSGi Bundle Project
OSGi Composite Bundle Project
OSGi Fragment Project
Blueprint File

you need to have IBM Rational Development Tools for OSGi Applications installed.

Why do we need these tools?

  •     Create and edit OSGi bundles, composite bundles, bundle fragments, and applications.
  •     Import and export OSGi bundles, composite bundles, bundle fragments, and applications.
  •     Convert existing Java Enterprise Edition (Java EE) web, Java Persistence Application (JPA), plug-in, or simple Java projects into OSGi bundles.
  •     Edit OSGi bundle, application, and composite bundle manifest files.
  •     Create and edit OSGi blueprint configuration files.
  •     Edit OSGi blueprint binding configuration files.
  •     Diagnose and fix problems in your bundles and applications using validation and quick fixes.

Eclipse Plugin Installation

Before you install the tools, you must have the Eclipse Helios v3.6.2 package, Eclipse IDE for Java EE Developers installed.

1. Click on Help > Install New Software
2. Point to this update site – http://public.dhe.ibm.com/ibmdl/export/pub/software/rational/OSGiAppTools – and click on Add.
3. You’ll see a list of tools – OSGi Application Development Tools,  OSGi Application Development Tools UI, OSGi context-sensitive help, OSGi Help documentation, Rational Development Tools for OSGi Applications help documentation. Select all those are listed (you can ignore help stuff) and go ahead with the installation.

As of writing this, the  development tools’ version is 1.0.3.

Maven Integration

If you want to manage any of these OSGi projects using Maven, you can right-click on it and select Maven > Enable Dependency Management. You need to have Maven Integration for Eclipse(m2e) installed for this which you can find in Eclipse Marketplace.

If you use Maven, you can try using the plugins provided by Apache Felix project for bundling (building an OSGi bundle).

More on this plugin @

http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html, http://felix.apache.org/site/apache-felix-maven-osgi-plugin.html

References: http://www.ibm.com/developerworks/rational/downloads/10/rationaldevtoolsforosgiapplications.html#download

From http://singztechmusings.wordpress.com/2011/09/12/creating-osgi-projects-using-eclipse-ide-and-maven/

Understand the needs and benefits around implementing the right monitoring solution for a growing containerized market. Brought to you in partnership with AppDynamics.


Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}