Creating OSGi features

You create and configure an OSGi Liberty feature project.

Before you begin

Before you create an OSGi feature, you must create an OSGi bundle.

Procedure

  1. In the menu, click File > New > Other > OSGi > Liberty Feature project, and then click Next.
  2. In the wizard, specify the name of your project and click Next. For example: service.AgeServiceFeature.
  3. Select the OSGi bundle that will contain your OSGi feature. For example, select service.AgeService 1.0.0.
  4. Click Finish.
  5. Edit the SUBSYSTEM.MF file:
    1. Remove .qualifier from the Subsystem-Version parameter.
    2. Add the version number of your service to the IBM-ShortName and Subsystem-SymbolicName parameters. For example:
      IBM-ShortName: service.AgeServiceFeature_1.0.0
      Subsystem-SymbolicName: service.AgeServiceFeature_1.0.0;visibility:=public
    3. Add the package of your service. For example: IBM-API-Package: service.ageservice;version="2.0.0". The package enables the service to be used by other applications, features, and the Liberty kernel. The package must match the Export-Package of your service.
  6. Save the changes.

Results

The OSGi feature is ready to be built and deployed.