Eclipse RCP - 导出了错误的插件版本

Eclipse RCP - Wrong plugin version gets exported

我有一个 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 作为版本号 - 但也没有用(依赖项旁边有一个小的红色标记,但没有错误显示 - 出口产品的行为保持不变)。

有什么地方我做错了吗?如何控制导出的插件版本?

在尝试了所有可能的组合之后,我终于找到了为什么它首先不起作用的错误:

仅在依赖项选项卡上指定版本号是不够的,还需要准确构建插件时的时间戳。因此,我必须指定 1.7.0.v20101104133 而不是 1.7.0(也与 运行 配置中显示的完全一样)。这解决了问题,导出最终使用与 运行-配置相同的插件版本。

我遇到了同样的问题,但我找到了这个问题的另一个可能的解决方案。

如果导出产品时勾选"Generate p2 repository"

然后会导出很多不同版本的插件,问题解决了,一直不知道为什么。