Gradle存储在本地文件系统上 [英] Gradle store on local file system
问题描述
Gradle如何在本地文件系统上存储下载的jar文件? Maven将它们存储在 USER_HOME
下的 .m2
目录中,但Gradle将它们存储在哪里?我在那里检查了 .gradle
文件夹,但只看到了编译后的脚本。
How does Gradle store downloaded jar files on the local file system? Maven stores them in the .m2
directory under USER_HOME
, but where does Gradle store them? I checked the .gradle
folder there, but saw only compiled scripts.
推荐答案
< Gradle在 USER_HOME / .gradle
文件夹中缓存工件。编译的脚本通常位于项目文件夹的 .gradle
文件夹中。
Gradle caches artifacts in USER_HOME/.gradle
folder. The compiled scripts are usually in the .gradle
folder in your project folder.
如果找不到缓存,也许这是因为你还没有缓存任何工件。您可以随时查看Gradle使用简单脚本缓存工件的位置:
If you can't find the cache, maybe it's because you have not cached any artifacts yet. You can always see where Gradle has cached artifacts with a simple script:
apply plugin: 'java'
repositories{
mavenCentral()
}
dependencies{
compile 'com.google.guava:guava:12.0'
}
task showMeCache << {
configurations.compile.each { println it }
}
现在,如果你运行 gradle showMeCache
它应该将代码下载到缓存并打印完整路径。
Now if you run gradle showMeCache
it should download the deps into cache and print the full path.
这篇关于Gradle存储在本地文件系统上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!