How make Eclipse uses maven projects even if Workspace resolution is not working?

旧时模样 提交于 2019-12-25 02:25:07

问题


In theory, enabling Workspace resolution should make Eclipse to use the current project rather to go to the repository.

But it may fail, for different reasons. In my case, two projects A and A-test. Both of them have

  • many subprojects/modules
  • a main pom.xml that mentions such modules

I imported all of them in the same workspace.

Now, when running project in A-test, the only way to see the effect of a change in A is do a mvn install, so the jar is updated in local repository.

Enabling workspace resolution wasn't helping. Although, it sort of works when Debugging from Eclipse. A real mess.

So, how can I make sure projects in A-test are looking at Eclipse's A?


回答1:


It seems the workspace resolution is not exact. When projects are related through a common/global pom.xml, it seems to work.

So, in my case, per project in A-test, I did

  • Right click, Build Path, Config Build path
  • Tab "Projects": add all the A projects (in my case, that's safe)
  • Tab "Order and Export": make sure A projects are BEFORE projects in M2. I just move all the A projects to top.

Now, when I ran a project in A-test, it's looking at A.

NB: - Eclipse Oxygen - A does not depends on A-test, at all.



来源:https://stackoverflow.com/questions/50105371/how-make-eclipse-uses-maven-projects-even-if-workspace-resolution-is-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!