如何强制 gradle 重新下载依赖项? [英] How can I force gradle to redownload dependencies?
问题描述
如何告诉 gradle 从存储库重新下载依赖项?
How can I tell gradle to redownload dependencies from repositories?
推荐答案
通常,您可以使用命令行选项 --refresh-dependencies.也可以删除~/.gradle/caches
下的缓存文件.在下一次构建中,Gradle 会尝试再次下载它们.
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.
您的具体用例是什么?您使用的是动态依赖版本还是 SNAPSHOT 版本?
What is your specific use case? Do you use dynamic dependency versions or SNAPSHOT versions?
在 Unix 系统上,您可以使用以下方法删除 Gradle 下载的所有现有工件(工件和元数据):
On Unix systems, you can delete all the existing artifacts (artifacts and metadata) Gradle has downloaded using:
rm -rf $HOME/.gradle/caches/
这篇关于如何强制 gradle 重新下载依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!