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 install
ed 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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With