代码改变世界

[Gradle] 如何强制 Gradle 重新下载项目的依赖库

2017-06-28 18:00  shaobin0604  阅读(8544)  评论(0编辑  收藏  举报

强制刷新 Gradle 依赖库缓存

$ gradle build --refresh-dependencies

The --refresh-dependencies option tells Gradle to ignore all cached entries for resolved modules and artifacts. A fresh resolve will be performed against all configured repositories, with dynamic versions recalculated, modules refreshed, and artifacts downloaded.

删除 gradle cache

$ rm -rf $HOME/.gradle/caches/