0

我尝试按照 enRoute 的教程进行操作,然后为 OSGI 6 定制它们。

我有一个作为 enRoute 项目生成的顶级项目,它具有 enRoute 依赖项和 bnd maven 插件。我添加了额外的依赖项:osgi.core:6.0.0, org.apache.felix.gogo.runtime,shell,console

此外,还有一个作为 enRoute Application 创建的 Maven 模块,它使用顶级项目作为父项目并从那里导入额外的依赖项。

在模块上运行mvn package后,出现一些错误:

[错误] 无法执行目标 biz.aQute.bnd:bnd-export-maven-plugin:4.1.0:export (default) on project my-bundle: null: MojoExecutionException:

在这个 NullPointer 之前,我看到 bnd/maven正在尝试收集依赖项,它确实找到了我的东西:example.my-project.my-module、osgi.core、org.apache.felix.framework、org.apache.felix。 gogo.shell等

[DEBUG] my-module: 添加资源 javax.servlet-api version=3.1.0 version=9.4.15.v20190215 [DEBUG] my-module: 添加资源 org.apache.commons.fileupload version=1.3.3 [DEBUG] my-module: 添加资源 org.apache.commons.io version=2.6.0 [DEBUG] my-module: 添加资源 org.apache.felix.http.servlet-api version=1.1.2 [DEBUG] my-module:添加资源 org.apache.felix.framework version=6.0.2 [DEBUG] my-module: 添加资源 example.my-project.my-module version=1.0.0.201905020747 [DEBUG] my-module: list(null) [org .apache.felix.http.jetty、org.apache.felix.gogo.shell、org.apache.felix.http.servlet-api、jaxb-api、osgi.core、org.apache.felix.framework、javax.servlet -api、example.my-project.my-module、org.osgi.service.http.whiteboard、org.apache.felix.gogo.command、org.apache.felix.configadmin、org.osgi.service。日志,org.apache.felix.gogo.runtime,org.apache.felix.webconsole]

然后 Maven 尝试使用错误更新运行包:

[DEBUG] init [DEBUG] 行为空,args=C:/workspace/my-project/my-module/target/tmp/export/my-module/cnf/cache/4.1.0/bnd-cache [DEBUG]原来的-runbundles是:\org.apache.felix.gogo.shell;version=1.0.0,\org.apache.felix.gogo.runtime;version=1.0.10,\org.apache.felix.gogo.command;版本=1.0.2,\ org.apache.felix.webconsole;版本=4.3.4,\ org.apache.felix.http.jetty;版本=4.0.6,\ org.apache.felix.http.servlet-api ;version=1.1.2 [DEBUG] 已解决 -runbundles 为:null

当我试图帮助 bnd 时,原来的 -runbundles 是由我手工填充的。但是 BND 并没有更新新的(事实上,它根本没有更新)

  1. 这是在您的项目中包含新捆绑包的正确方法吗?要将它们添加为依赖项(稍后,来自 bnd 的 maven 插件将使用 -runbundles 中的条目更新我的 .bndrun 文件)?
  2. 什么插件更新了 .bndrun 中的 -runrequires 以及我在哪里放置我的条目以让 BND 读取它们?
  3. .bndrun 中 -buildpath 的相同问题
  4. .bndrun 中 -runfw 的相同问题
4

0 回答 0