Eclipse 插件无法在 Ganymede 中工作,但在 Galileo 中工作

标签 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 一起粘贴到他们的插件目录中.它们是否有可能与现有的较低版本插件包冲突?

最佳答案

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

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

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

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

[3.0.0, 4.0.0)

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

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

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

关于Eclipse 插件无法在 Ganymede 中工作,但在 Galileo 中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1491143/

相关文章:

java - Eclipse 插件 : Creating a dynamic menu and corresponding handler?

eclipse - 使 Eclipse 项目依赖项与外部构建系统保持同步

java - Android - 找不到抛出 NullPointerException 的内容

包含 unicode 的 java 文件无法编译

.net - 插件 AppDomains 解决方法

css - Eclipse 4 主题

java - 如何从 intellij 中的调试变量值生成模拟?

java - Gradle插件:JavaExec运行时出错

javascript - Chrome 扩展仅适用于 "developer.chrome.com"

plugins - 编写屏幕共享插件/驱动程序