Gradle store on local file system

后端 未结 15 1164
[愿得一人]
[愿得一人] 2020-12-04 05:12

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

15条回答
  •  不知归路
    2020-12-04 05:57

    Gradle caches artifacts in USER_HOME/.gradle folder. The compiled scripts are usually in the .gradle folder in your project folder.

    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 }
    }
    

    Now if you run gradle showMeCache it should download the deps into cache and print the full path.

提交回复
热议问题