+

Search Tips   |   Advanced Search

Specify API and SPI packages for a Liberty feature project

Use the Liberty feature manifest file to declare which packages to share as an API or SPI with other applications and features in the Liberty runtime environment.

A package cannot be declared as an API or SPI unless it is exported by a bundle in the Liberty feature, by being listed in the Export-Package header of the bundle manifest file.

To specify API and SPI packages for a Liberty feature project:

  1. From the Project Explorer view, open the feature manifest file for the Liberty feature project by double-clicking the Manifest node in the project hierarchy, indicated by the manifest icon (

    ).

  2. To make one or more API packages available to OSGi applications, click Add in the IBM API Packages pane.

  3. When we create our own Liberty feature, you install it into the user product extension, and all the packages in the feature can be accessed by any other feature installed into the user product extension. To make one or more SPI packages available to features in other product extensions, click Add in the IBM SPI Packages pane.

  4. Optional. Package version by selecting the package, clicking Properties, and entering the required value in the Version field.

  5. Optional. For an API package, select the package type from the Type list in the Properties dialog box. The type can be one of the following values:

    • spec - Indicates an API provided by a standard body, such as javax.servlet or org.osgi.framework.

    • ibm-api - Indicates a value-add API provided by IBM .

    • api - Indicates a user-defined API. This is the default value.

    • third-party - Indicates an API that is visible, but not controlled by IBM. Typically, these are open source packages.

    • internal - Indicates non-API packages that must be exposed to applications for them to function. This might be used if Java code is bytecode enhanced, or weaved, to add references to internal code at run time.


Results

The package names are added to the IBM-API-Package and IBM-SPI-Package headers in the feature manifest file. For more information on the headers in the feature manifest file for a Liberty feature, see Liberty feature manifest files.


Parent topic: Create a Liberty feature using developer tools

Tasks:

  • Create a Liberty feature project
  • Add OSGi bundles to a Liberty feature project
  • Install a Liberty feature to the Liberty profile V8.5.5
  • Manually installing a Liberty feature to the Liberty profile V8.5 or earlier