Eclipse插件不在Ganymede工作,但在Galileo工作

时间:2009-09-29 07:59:46

标签: eclipse plugins

我在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一起粘贴到他们的插件目录中。他们是否有可能与已经存在的较低版本的插件包发生冲突?

1 个答案:

答案 0 :(得分:3)

问题发生是因为您的依赖声明声明了要使用的最小版本,因此在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用户带来各种各样的问题,因为其他插件可能无法正常使用它们

相关问题