Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible for Gradle projects in Eclipse/STS to resolve dependencies to other Gradle projects in the same workspace?

A Gradle project in my workspace (call it Downstream) needs to depend on another Gradle project (call it Upstream). Outside of Eclipse, of course Upstream would need to be build and installed before Downstream (so that Gradle can resolve it). In Eclipse, since both projects are in the workspace together, I'd like to have Gradle look in the workspace first and make the dependency between the projects, not from the repo.

m2e (Maven integration for Eclipse) does this (the option is called Resolve dependencies from Workspace). Gradle Eclipse plugin has an option called Remap Jars to maven projects but that seems to do this for pom-driven m2e projects, not other Gradle projects.

Is there any way to get Gradle to resolve dependencies to the local workspace (when they're present) instead of the repo?

like image 635
E-Riz Avatar asked Oct 09 '14 16:10

E-Riz


1 Answers

It turns out this is was an outstanding feature request for Gradle IDE. It has been delivered for the 3.6.3 release of Gradle IDE.

You do have to enable it, though:

The feature has to be enabled in the Gradle preferences page. Access via "Window >> Preferences >> Gradle".

If you are not seeing the "remap jars to Gradle projects" there then maybe double check that version of the Gradle plugins is indeed 3.6.3. Maybe something went wrong during the upgrade and you are still using an older version. Source

like image 162
E-Riz Avatar answered Sep 19 '22 02:09

E-Riz