3

We use the Apache Felix maven-bundle-plugin to generate a manifest for our fragment bundle. This fragment bundle is intended to override resources on a Liferay host bundle. The Liferay DXP documentation specifies that the developer ought to include a Provide-Capability header in their manifest to override the host bundle's resources. However, the Apache Felix maven-bundle-plugin documentation does not specify how to do so in the plugin, or whether this is possible.

Is there any way for us to add the Provide-Capability header using the Apache Felix maven-bundle-plugin?

CJ Virtucio
  • 315
  • 1
  • 4
  • 12

1 Answers1

3

For maven-bundle-plugin, you just put <Provide-Capability>...</Provide-Capability> in the plugins configuration making sure to replace ... with the desired value of the header.

In fact, you can add any of the manifest headers defined in the OSGi spec. It's specified in the documentation as follows:

The BND library underlying the plugin defines instructions to direct its behavior. For this Maven plugin, these instructions are issued in the plugin configuration section of the POM file, as was illustrated above. BND recognizes three types of instructions

1. Manifest headers - Any instruction that starts with a capital letter will appear in the resulting bundle's manifest file; the value for the header will either be copied, augmented, or generated by BND depending on the instruction.

  1. Variables - Any instruction starting with a lowercase letter is assumed to be a variable in the form of a name-value pair, such as version=3.0, that can be used for property substitution, but is not copied to the manifest.

  2. Directives - Any instruction starting with a '-' character is considered to be a directive that informs BND to perform some special processing and is not copied to the manifest

CJ Virtucio
  • 315
  • 1
  • 4
  • 12
BJ Hargrave
  • 9,324
  • 1
  • 19
  • 27