我正在尝试将现有的 EclipsePDE 应用程序移植到 BNDTools,但我遇到了问题。
我有一个包含多个子包的项目。其中一个使用 org.jscience,我从一个非索引的 Nexus 存储库中获得。这是 bnd.bnd 文件:
-sub: \
*.bnd
-runee: JavaSE-1.8
-runfw: org.apache.felix.framework;version='[4.2.1,4.2.1]'
-buildpath: \
osgi.core,\
osgi.cmpn,\
biz.aQute.bnd.annotation,\
org.apache.felix.http.jetty,\
org.apache.felix.http.whiteboard,\
org.eclipse.jdt:org.eclipse.jdt.annotation;version=2.0.0,\
slf4j.api,\
org.apache.commons.collections,\
org.apache.commons.lang3,\
biz.aQute.junit,\
org.apache.commons.io,\
org.jscience:jscience;version=4.3.1,\
com.vaadin:vaadin-server;version=7.3.6
我手动将依赖项添加到 org.jscience。
这是有问题的子包的 .bnd 文件:
Export-Package: \
com.mycompany.commons.util.encryption,\
com.mycompany.commons.util.osgi,\
com.mycompany.commons.util
对 org.jscience.physics.amount 的依赖在子包的“Calculated Imports”中可见。没有编译错误(或项目上的任何其他错误)。
这是我遇到问题的 .bndrun 文件:
-runfw: org.apache.felix.framework;version='[4.4.1,4.4.1]'
-runee: JavaSE-1.8
-runsystemcapabilities: ${native_capability}
-resolve.effective: active;skip:="osgi.service"
-runrequires: \
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.shell)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.command)',\
osgi.identity;filter:='(osgi.identity=com.mycompany.commons.commons.util)'
(我知道包和捆绑包的命名很奇怪,但这不是现在的问题)
使用此运行配置,我尝试使用“解决”按钮来解决运行配置所需的运行包,但我收到以下消息:
requires com.mycompany.commons.commons.util
com.mycompany.commons.commons.util 0.0.0 requires Import-Package: javax.measure.quantity
我尝试自己创建运行包,如下所示:
-runfw: org.apache.felix.framework;version='[4.4.1,4.4.1]'
-runee: JavaSE-1.8
-runsystemcapabilities: ${native_capability}
-resolve.effective: active;skip:="osgi.service"
-runrequires: \
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.shell)',\
osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.command)',\
osgi.identity;filter:='(osgi.identity=com.mycompany.commons.commons.util)'
-runbundles: \
ch.qos.logback.classic;version='[1.1.2,1.1.3)',\
ch.qos.logback.core;version='[1.1.2,1.1.3)',\
com.mycompany.commons.commons.util;version=latest,\
org.apache.commons.collections;version='[3.2.1,3.2.2)',\
org.apache.commons.lang3;version='[3.1.0,3.1.1)',\
org.apache.felix.gogo.command;version='[0.14.0,0.14.1)',\
org.apache.felix.gogo.runtime;version='[0.12.1,0.12.2)',\
org.apache.felix.gogo.shell;version='[0.10.0,0.10.1)',\
slf4j.api;version='[1.7.7,1.7.8)',\
org.jscience;version=latest
但是,如果我尝试运行运行配置,我只会收到无法找到 org.jscience 的消息。
当然我做错了什么,但是什么?任何帮助是极大的赞赏。