Java – How to update gradle dependencies without building the project

gradleintellij-ideajava

I'm looking for a way to refresh my gradle dependencies without having to rebuild the project. I'm using Intellij and its Gradle Wrapper. I've tried running the task 'Dependencies' from IntelliJ's gradle UI, I've tried running the command gradle --refresh-dependencies AND gradlew --refresh-dependencies, both don't work. The only way to make gradle download new dependencies is to use Refresh All Gradle Project from IntelliJ UI but I don't like doing this because gradle automatically runs some tasks I don't want to run when I'm only looking to refresh the dependencies.

Best Answer

Try running ./gradlew dependencies --refresh-dependencies, it will list dependencies and download them without building.