我有一个带有基于插件的产品配置的eclipse 4应用程序项目。所有必要的插件都会添加到.product文件中的依赖项选项卡中。从这个.product文件生成一个运行配置是完美无缺的。但是当将.product作为eclipse产品导出时,它不起作用 - 可能是因为导致一些插件的错误版本被导出。
错误日志包含以下消息:
org.osgi.framework.BundleException: Could not resolve module: org.eclipse.e4.ui.css.swt [24]
Unresolved requirement: Require-Bundle: org.eclipse.e4.ui.css.core; bundle-version="0.9.0"
-> Bundle-SymbolicName: org.eclipse.e4.ui.css.core; bundle-version="0.11.0.v20150511-1937"; singleton:="true"
org.eclipse.e4.ui.css.core [23]
Unresolved requirement: Require-Bundle: org.apache.batik.css; bundle-version="1.7.0"
at org.eclipse.osgi.container.Module.start(Module.java:434)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
问题是,在/ plugins /文件夹中我只有org.apache.batik.css
的v1.6.0以及我尝试过的任何内容,我无法通过eclipse导出v1.7.0(但在运行配置本身,我可以看到使用了1.7.0。
我尝试使用Dependencies选项卡上的“Properties ...”按钮并指定1.7.0作为版本号 - 但也没有用(依赖项旁边有一个小红色标记,但没有显示错误) - 导出产品中的行为保持不变)。
我在这里做错了吗?如何控制导出的插件版本?
答案 0 :(得分:2)
在尝试了所有可能的组合后,我终于找到了为什么它首先没有起作用的错误:
仅仅在依赖项选项卡上指定版本号是不够的,而且还需要准确构建插件时的时间戳。因此,我不得不指定1.7.0
而不是1.7.0.v20101104133
(完全如同在运行配置中显示的那样)。这解决了问题,导出最终使用与run-configuration相同的插件版本。
答案 1 :(得分:1)
我遇到了同样的问题,但我找到了解决这个问题的另一个问题。
如果在导出产品时填写“生成p2存储库”。
然后有很多不同版本的插件将被展开,问题解决了,我仍然不知道为什么会这样。