How can I force gradle to redownload dependencies?

fedor.belov picture fedor.belov · Nov 26, 2012 · Viewed 641.5k times · Source

How can I tell gradle to redownload dependencies from repositories?

Answer

Benjamin Muschko picture Benjamin Muschko · Nov 26, 2012

Generally, you can refresh dependencies in your cache with the command line option --refresh-dependencies. You can also delete the cached files under ~/.gradle/caches. With the next build Gradle would attempt to download them again.

What is your specific use case? Do you use dynamic dependency versions or SNAPSHOT versions?


On Unix systems, you can delete all the existing artifacts (artifacts and metadata) Gradle has downloaded using:

rm -rf $HOME/.gradle/caches/