开发者

Why do you have to define dependencies twice in Eclipse RCP?

开发者 https://www.devze.com 2022-12-20 06:16 出处:网络
I have an Eclipse RCP plug-in project, called proj.a. I have another Eclipse RCP plug-in project, proj.b, which has a product definition file in it. This project uses depends on the proj.a plug-in.

I have an Eclipse RCP plug-in project, called proj.a.

I have another Eclipse RCP plug-in project, proj.b, which has a product definition file in it. This project uses depends on the proj.a plug-in.

When I change proj.a, say to include JUnit tests, the dependency to JUnit is automatically added to the build path of proj.a.

But when I go to run the product I have defined in proj.b, I have to manually add the dependency to the product definition in开发者_如何学Go proj.b.

Why is that? Can't eclipse figure out that the product depends on JUnit? Or is this the problem domain of Buckminster and Maven and the like?


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.


I'm not sure this will help but you need to reexport the dependency if you want other plugins downstream to see the dependencies plugin A have. You can do that on the Dependency tab in the PDE-editor (Properties button)


You don't have to manually add dependencies; there is an "Add required plug-ins" button.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号