osgi - 如何在 Apache Felix maven-bundle-plugin 中设置 Provide-Capability header ?

标签 osgi apache-felix liferay-7

我们使用 Apache Felix maven-bundle-plugin 为我们的片段包生成 list 。此片段包旨在覆盖 Liferay host 包上的资源。 Liferay DXP documentation指定开发人员应在其 list 中包含一个 Provide-Capability header 以覆盖主机包的资源。然而,Apache Felix maven-bundle-plugin documentation没有指定如何在插件中这样做,或者这是否可能。

我们有什么方法可以使用 Apache Felix maven-bundle-plugin 添加 Provide-Capability header 吗?

最佳答案

对于 maven-bundle-plugin ,你只需输入 <Provide-Capability>...</Provide-Capability>在插件配置中确保替换 ...具有标题的所需值。

事实上,您可以添加 OSGi spec 中定义的任何 list header 。 .这是specified in the documentation如下:

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

关于osgi - 如何在 Apache Felix maven-bundle-plugin 中设置 Provide-Capability header ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57397785/

相关文章:

java - 在运行时在创建的 spring bean 中使用 @Scheduled 注释

android - Apache Felix 可以在新的 Android RunTime (ART) 中运行吗?

mysql - Liferay 7.0 从一个数据库到另一个数据库的数据迁移

java - 如何防止Liferay <aui :form> form submission with Javascript?

java - OSGI 包中的 Pojo

eclipse - 在 Eclipse 中编译并运行 OSGI 应用程序

java - 联合身份管理

java - 如何从代码启动和使用 Apache Felix?

java - 带有 Maven bundle 插件的 OSGi 未加载库

liferay-7 - Liferay- 删除控制面板菜单