我已经使用开普勒编写了一个Eclipse插件。现在,它的代码已完成,我尝试使用Juno进行安装以测试向后兼容性,并在安装时出现此错误:
Only one of the following can be installed at once:
Expression Language 3.4.300.v20110228 (org.eclipse.core.expressions
3.4.300.v20110228)
Expression Language 3.4.401.v20120912-155018
(org.eclipse.core.expressions 3.4.401.v20120912-155018)
Expression Language 3.4.401.v20120627-124442
(org.eclipse.core.expressions 3.4.401.v20120627-124442)
Expression Language 3.4.400.v20120523-2004
(org.eclipse.core.expressions 3.4.400.v20120523-2004)
Expression Language 3.4.501.v20131118-1915
(org.eclipse.core.expressions 3.4.501.v20131118-1915)
如上所示,开普勒想要表达式3.4.500,而朱诺使用3.4.401。我尝试从org.eclipse.core.expressions插件中删除最低版本要求(之前已将其设置为3.4.500),但无济于事。
编写同时支持Juno和Kepler的插件的正确方法是什么?至少解决该依赖性问题需要什么?
根据要求,清单如下:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: My Plugin
Bundle-SymbolicName: com.mycompany.eclipse;singleton:=true
Bundle-Version: 0.2.2
Bundle-Activator: com.mycompany.eclipse.Activator
Bundle-Vendor: MyCompany Inc
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources;bundle-version="3.8.1",
org.eclipse.jface.text;bundle-version="3.8.2",
org.eclipse.ui.ide;bundle-version="3.8.2",
org.eclipse.ui.editors;bundle-version="3.8.0",
org.eclipse.jdt.core;bundle-version="3.8.3",
com.mycompany.eclipse.dependencies;bundle-version="0.1.3",
org.eclipse.ui.forms;bundle-version="3.6.0",
org.eclipse.core.expressions;bundle-version="3.4.500"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7,
JavaSE-1.6
Bundle-ActivationPolicy: lazy
sherpaManifest-Version: 1.0
Bundle-ClassPath: .,
resources/,
icons/,
static/
根据comment on this question的说法,插件永远不会向后兼容。有人对这个有经验么?
最佳答案
插件bundle-version
中Require-Bundle
条目中插件的MANIFEST.MF
值确定所需依赖项的版本。
你有:
org.eclipse.core.expressions;bundle-version="3.4.500"
也就是说您的插件至少需要表达式插件3.4.500版本。将版本更改为3.4.401以与Juno一起使用。