【问题标题】:How to target both Juno and Kepler如何同时瞄准朱诺和开普勒
【发布时间】:2014-04-02 19:42:51
【问题描述】:

我使用 Kepler 编写了一个 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) 

如上所示,Kepler 需要表达式 3.4.500,而 Juno 使用 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,插件永远不会向后兼容。有人有这方面的经验吗?

【问题讨论】:

  • 向我们展示您的插件的 MANIFEST.MF。
  • @greg-449,根据您的要求添加。

标签: java eclipse-juno eclipse-plugin eclipse-kepler eclipse-pde


【解决方案1】:

插件MANIFEST.MFRequire-Bundle 条目中插件的bundle-version 值确定所需依赖项的版本。

你有:

org.eclipse.core.expressions;bundle-version="3.4.500"

也就是说,您的插件至少需要 3.4.500 版本的表达式插件。将版本更改为 3.4.401 以使用 Juno。

【讨论】:

  • 如果我们删除bundle-version="3.4.500"。平台是指最新版本(如果发现多个版本)或可用的版本。对吗?
  • @ChandrayyaGK 是的,它将使用任何可用的。
  • @greg-449,我试过了,结果一样,仍然需要 3.4.500。
  • 是你安装的插件还是其他插件(比如表达式插件)?
  • 这只是我的插件,但我注意到在我构建它的时候,站点中包含了表达式 3.4.500 jar 文件。
猜你喜欢
  • 1970-01-01
  • 2018-03-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多