0

I'm looking into migrating some of our ancient maven projects over to gradle (so shiny). Things are looking pretty good however I'm unable to get Eclipse/Gradle to adjust the project dependencies appropriately when I have 2 projects checked out. I'm hoping to use a repo for standard jar dependencies but be able to depend directly on a project if it is checked out.

Let's say ProjectB depends on ProjectA. As far as I understand the Eclipse/Maven plugin, it is able to a:

  1. Interrogate the maven dependency for ProjectA and understand its group/artifact/version tuple.
  2. Look through ProjectA eclipse project (if imported) to see if has the same group/artifact/version.
  3. Replace the jar dependency with a project dependency.

This is a powerful feature because it means that a developer does not need to import ProjectA when they are working on ProjectB -- they just get it from the repo. But if they do have it imported, they can make a refactor to ProjectA in Eclipse and it will automagically refactor the dependent code in ProjectB.

How can I get eclipse/gradle to adjust the build-path so that there is a project dependency when available otherwise use the jar?

Things I've looked into:

Anyone else figured this out? Thanks much in advance.

Gray
  • 108,756
  • 21
  • 270
  • 333
  • What do you mean by *I doubt that findProject(...) is doing the right thing under Eclipse*? Eclipse should not be involved in resolving the dependency, it should only transform Gradle projects into Eclipse projects and link dependencies between them in the same way as Gradle would do it. – Lukas Körfer Jun 25 '18 at 13:49
  • I'll flesh it out. I was doubting that findProject() was able to find the project loaded into Eclipse @lu.koerfer. – Gray Jun 25 '18 at 14:08

0 Answers0