【发布时间】:2019-04-12 06:18:07
【问题描述】:
我目前正在一个项目中工作,我需要将 PDE 样式插件转换为 bnd 样式插件。 我遇到了外部 jar 的问题,所以我为每个 jar 构建捆绑包并将它们包含到构建路径中。对于大多数罐子来说,这都很好,但我得到了一个不符合预期的罐子。
org.apache.commons.codec.language。这个包来自 jar org.apache.commons.codec,它解析得很好(至少对于 bndtools)但是当我运行这个包时,我得到了以下错误:
! could not resolve the bundles: [test-0.0.0 org.osgi.framework.BundleException: Could not resolve module: test [1]
Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"
]
! Failed to start bundle test-0.0.0, exception Could not resolve module: test [1]
Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"
org.osgi.framework.BundleException: Could not resolve module: test [1]
Unresolved requirement: Import-Package: org.apache.commons.codec.language; version="[1.9.0,2.0.0)"
at org.eclipse.osgi.container.Module.start(Module.java:447)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:431)
at aQute.launcher.Launcher.startBundles(Launcher.java:519)
at aQute.launcher.Launcher.activate(Launcher.java:425)
at aQute.launcher.Launcher.run(Launcher.java:303)
at aQute.launcher.Launcher.main(Launcher.java:149)
在这个 github 存储库中,我提取了一个会产生错误的代码作为参考:https://github.com/MaPhil/osgi-externals-test
我在 Google 上搜索了很多关于这个主题的信息,但大多数答案似乎都与 liferay 或其他特定库有关。我希望你们中的任何人都可以给我一个提示。
【问题讨论】: