I am using STS/Eclipse to work on several Gradle projects which I have loaded on my workspace.
Some projects have dependencies on other projects, so I often need to perform Gradle builds into jar files, followed by a Gradle -> Refresh Dependencies and build up my dependency tree. This works fine, although I have noticed that sometimes Gradle will attempt to refresh the dependencies for all the projects in my workspace (even projects which are completely unrelated).
Not only is it bothersome and time-consuming having to wait for gradle to refresh all projects, but it also makes it difficult to debug issues with conflicting dependencies in the cache: Sometimes I want to disable a specific dependency on project A, but it still gets loaded to cache because an unrelated project B also has that dependency.
Is there a way to make gradle refresh the dependencies only for the project(s) I select instead of everything on my workspace?
For reference, I'm using STS version 3.6.3.RELEASE on Eclipse Kepler SR2 (4.3.2) using plugin Gradle IDE 3.6.3.201411271013-RELEASE org.springsource.ide.eclipse.gradle.feature.feature.group
Seems this is an issue with the Gradle plugin on STS after all. How I solved it:
Opened Window -> Preferences ; selected Gradle menu
Disabled "Remap Jars to maven projects" and "Remap Jars to Gradle Projects".
Not sure if this is also related/necessary, but I also:
Opened External Tools Configurations menu (Right click on project, Run as -> External Tools Configurations).
Went to the "Refresh" tab and changed the "Refresh resources upon completition" option from "The entire workspace" to "The project containing the selected resource" and applied changes.
Now I can perform gradle builds and refresh dependencies only on the projects I select instead of all projects on my workspace. Though if the project I select includes dependent jar files with missing dependencies, those will also be downloaded to cache (which makes sense).
Found useful information about this issue here:
https://github.com/spring-projects/eclipse-integration-gradle/issues/57