Dependency version change in build.gradle does not update IntelliJ project

Hello group,

I'm starting to use Gradle as my build tool of choice. I've got an issue with the integration of Gradle in IntelliJ. Whenever I change the version of a dependency in the Gradle build file and hit the refresh button in the JetGradle tool window, I see the new version of the dependency as well as the old version of the dependency. I can import the new version from the JetGradle window, and IntelliJ refreshes the project structure, but the old version stays in the project dependencies and there's no way (that I can see at least) to remove the old one. The old version of the dependency even stays present in the JetGradle window.

The same situation happens if I remove a dependency altogether from the Gradle build file. It stays in the project structure.

Am I missing something?

Thanks a lot


Comment actions Permalink

I don't think you are missing anything, in my experience the Gradle integration as far as dependency management goes is half-baked and more trouble than it's worth at the moment.

I've just added a new dependency and no matter how many times I refresh the Gradle project (which is also painfully slow) it doesn't show up, so I waste 30 minutes invalidating caches, restarting etc... to no avail. grrr

Comment actions Permalink

Ok, thanks for the feedback. What I do now to go around the problem is, whenever I change/remove a dependency in my build.gradle file, I go in the project settings settings and basically drop every library. I then go in the JetGradle window and reimport the dependencies. It's the only reliable way I found to make sure the project is perfectly synced with the gradle config. It is quite a pain, but it works.

So I guess the tooling for Gradle is not yet up to par with what's available for Maven. I think I will file a bug/improvement for this feature.


Please sign in to leave a comment.