【问题标题】:Eclipse plugin not working in Ganymede but working in GalileoEclipse 插件在 Ganymede 中不起作用,但在 Galileo 中起作用
【发布时间】:2009-09-29 07:59:46
【问题描述】:

我在 eclipse Galileo 中做了一个插件。我的插件具有以下依赖项:

Require-Bundle: org.eclipse.ui;bundle-version="3.5.0",
 org.eclipse.core.runtime;bundle-version="3.5.0",
 org.eclipse.core.resources;bundle-version="3.5.0",
 org.eclipse.jdt.core;bundle-version="3.5.0",
 org.eclipse.jdt.ui;bundle-version="3.5.0"

但由于 Ganymede 有上述不同的版本,即:

Require-Bundle: org.eclipse.ui;bundle-version="3.4.2",
 org.eclipse.core.runtime;bundle-version="3.4.0",
 org.eclipse.core.resources;bundle-version="3.4.2",
 org.eclipse.jdt.core;bundle-version="3.4.2",
 org.eclipse.jdt.ui;bundle-version="3.4.2"

相同的插件在两者中都不起作用。我暂时制作了两个插件,一个用于 Galileo,一个用于 Ganymede,在 manifest.mf 中存在上述差异

是否可以制作一个独立于 eclipse 类型的插件,因为将来制作新版本的 eclipse 时,我的插件将变得无用。即使所需的调整很少……是否有可能以某种方式使其独立

我想将所需的插件包(如 org.eclipse.core.runtime;bundle-version="3.5.0")与插件一起放置,并指示人们将它们与我的插件 jar 一起粘贴到他们的插件目录中.它们是否有可能与已经存在的较低版本的插件包冲突?

【问题讨论】:

标签: eclipse plugins


【解决方案1】:

问题发生是因为您的依赖声明声明了要使用的最低版本,因此在 Ganymede 上不满足要求并且未加载您的插件。如果插件与 Ganymede 兼容,请指定依赖版本,例如

org.eclipse.ui;bundle-version="3.4.2"

您将能够在两个平台(以及未来版本)上使用该插件。我会使用这种方法。

注意,如果您想包含您支持的特定范围的版本,您也可以将依赖项设置为version ranges。例如:

[3.0.0, 4.0.0)

将允许从 3.0.0 到 4.0.0 的任何版本(即任何 3.x 版本)

随着 Eclipse 4 的出现,这可能是您需要考虑的问题。

无论你做什么,都不要在你的发行版中包含 3.5 插件,这会给 Ganymede 用户带来各种问题,因为其他插件可能无法正常工作

【讨论】:

  • 所以清单中的条目应该是: Require-Bundle: org.eclipse.ui;bundle-version="[3.0.0, 4.0.0)", org.eclipse.core.runtime; bundle-version="[3.0.0, 4.0.0)", org.eclipse.core.resources;bundle-version="[3.0.0, 4.0.0)", org.eclipse.jdt.core;bundle- version="[3.0.0, 4.0.0)", org.eclipse.jdt.ui;bundle-version="[3.0.0, 4.0.0)" 我的仪式?
  • 您可以使用现有的 Ganymede 条目,它会起作用。我添加了版本范围以显示如果在 Eclipse 4 中使用该插件如何配置失败。请参阅关于版本范围链接的讨论以获取解释
猜你喜欢
  • 1970-01-01
  • 2016-04-28
  • 2018-09-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-11-12
  • 2011-11-08
相关资源
最近更新 更多