【问题标题】:How to provide library bundles in WSO2 feature definition?如何在 WSO2 功能定义中提供库包?
【发布时间】:2014-10-12 17:10:29
【问题描述】:

按照学生管理器示例,我设法准备 WSO2 功能(服务器 + ui + 聚合)并生成 p2 存储库。

由于缺少依赖项而无法安装聚合功能,例如我的 xxx.analyzer 组件(以及后来的一些 Apache Commons 库):

Cannot complete the install because one or more required items could not be found.
  Software being installed: My Manager Aggregate Feature 1.0.0 (xxx.mgt.feature.group 1.0.0)
  Missing requirement: xxx.mgt 1.0.0 (xxx.mgt 1.0.0) requires 'package xxx.analyzer 0.0.0' but it could not be found
  Cannot satisfy dependency:
    From: My Manager Aggregate Feature 1.0.0 (xxx.mgt.feature.group 1.0.0)
    To: xxx.mgt.server.feature.group [1.0.0]

我的包安装在本地 M2_REPO 中。 当我直接将它们安装到 WSO2 OSGi 控制台命令行中时,它们可以正常工作。

如何将它们包含到功能中?

【问题讨论】:

    标签: wso2 osgi p2


    【解决方案1】:

    您可以使用功能 pom 中 carbon-p2 插件的配置部分中的 <bundleDef>group.id:bundle.artifact.id</bundleDef> 将您的捆绑包包含到功能中。这将类似于下面的内容。

    ...
    <execution>
       <id>p2-feature-generation</id>
       <phase>package</phase>
       <goals>
          <goal>p2-feature-gen</goal>
       </goals>
       <configuration>
          <id>org.wso2.carbon.student.mgt.ui</id>
          ...
          <bundles>
             <bundleDef>org.wso2.carbon:org.wso2.carbon.student.mgt.stub</bundleDef>
             <bundleDef>org.wso2.carbon:org.wso2.carbon.student.mgt.ui</bundleDef>
          </bundles>
       </configuration>
    </execution>
    ...
    

    如果您需要包含一个功能而不是捆绑包,您可以在您的聚合功能 pom 中使用 &lt;includedFeatureDef&gt;group.id:feature.artifact.id&lt;/includedFeatureDef&gt;。两者的示例都可以在this tutorial 中找到。

    【讨论】:

    • 当我刚刚添加一个 时,我收到一个关于未知版本的包的错误。在 功能中添加标准 元素后,已正确构建。
    • 另一个提示:要消除传递依赖的问题,您可以使用 和 指令,如 Bundle Plugin for Maven documentation 中所述
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-09-01
    相关资源
    最近更新 更多