How to force re-download Gradle Dependencies

If you have a Java Project based on Gradle Build and you want to re-download all the dependencies that you have defined in your build.gradle file, then all you need to do is run the below command in command-line/terminal.


  1. Open Command-Line/Terminal in your IDE (Eclipse/VSCode/IntelliJ)
  2. Move to the location of your project where you have the gradlew file.
  3. Now run the below gradle command
  4. ./gradlew build --refresh-dependencies
  5. Once the build is complete run your project to verify.

Note: The --refresh-dependencies option tells Gradle to ignore all cached entries for resolved modules and artifacts.

It’s a common misconception to think that using --refresh-dependencies will force download of dependencies. This is not the case: Gradle will only perform what is strictly required to refresh the dynamic dependencies. This may involve downloading new listing or metadata files, or even artifacts, but if nothing changed, the impact is minimal.



Facing issues? Have Questions? Post them here! I am happy to answer!

Author: Rakesh
Author Info:

Rakesh is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap