English 中文(简体)
为什么在Eclipse RCP中必须两次定义依赖关系?
原标题:Why do you have to define dependencies twice in Eclipse RCP?

我有一个名为proj.a的Eclipse RCP插件项目。

我有另一个 Eclipse RCP 插件项目,proj.b,其中包含一个产品定义文件。该项目依赖于 proj.a 插件。

当我更改proj.a,例如添加JUnit测试时,项目对JUnit的依赖会自动添加到proj.a的构建路径中。

但是当我运行在proj.b中定义的产品时,我必须手动将依赖项添加到proj.b中的产品定义中。

为什么会这样呢? Eclipse难道不能意识到该产品依赖于JUnit吗?或者这是Buckminster和Maven等工具的问题领域吗?

最佳回答

The product file lists the whole dependency graph. If you add a dependency to Junit in plugin.a it s like you say plugin.a cannot be run without JUnit. And the product file lists all plugins that are defined in other plugins as depenedencies. So I m wondering why you add Junit as a dependency for your plugin.a Best practise is to create a separate plugin with all your testcases that references to plugin.a and Junit. And this newly created plugin is not listed in your product file (wo wants to ship JUnit and Testcases with the final build?) In addition there is no need to add dependencies manually In your product-editor you have a button "Add required plugins" which does that job for you.

问题回答

我不确定这会不会有帮助,但如果您想让下游的其他插件看到插件A所拥有的依赖项,您需要重新导出依赖项。您可以在PDE编辑器的“依赖项”选项卡中执行此操作(属性按钮)。

你不必手动添加依赖项; 有一个“添加所需的插件”按钮。





相关问题
In Eclipse, why doesn t "Show In" appear for non-Java files?

If I have a *java file open, I can right click on the source, scroll down to "Show In (Alt-Shift-W)", and select Navigator. If I have an *xml, *jsp, or pretty much anything besides a Java source ...

Eclipse: Hover broken in debug perspective

Since upgrading Eclipse (Galileo build 20090920-1017), hover in debug no longer displays a variable s value. Instead, hover behaves as if I were in normal Java perspective: alt text http://...

Eclipse smart quotes - like in Textmate

Happy Friday — Does anyone know if eclipse has the notion of smart quotes like Textmate. The way it works is to select some words and quote them by simply hitting the " key? I m a newbie here so be ...

Indentation guide for the eclipse editor

Is there a setting or plugin for eclipse that can show indentation guides in the editor? Something like the Codekana plugin for visual studio (not so fancy is also OK). Important that it works with ...

Adding jar from Eclipse plugin runtime tab

I want to add .jar files for plugin from the Runtime tab of manifest file. When I use the Add... button, I can see only sub-directories of the plugin project. So if I want to add same .jar file to ...

How to copy multiple projects into single folder in eclipse

I have two projects, Project1 and Project2. Now i want to copy this projects into eclipse workspace but i want these projects to be in a single folder like below. Eclipse Workspace -> Project -> ...

Java: Finding out what is using all the memory

I have a java application that runs out of memory, but I have no idea which code is allocating the memory. Is there an application with which I can check this? I use Eclipse.

热门标签