Gradle store on local file system

后端 未结 15 1102
[愿得一人]
[愿得一人] 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:53

    In Windows 10 PC, it is saved at:

    C:\Users\<user>\.gradle\caches\modules-2\files-2.1\
    
    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-04 06:00

    In case it is an Android gradle project - you can find the android libraries below your $ANDROID_HOME/extras/android/m2repository folder

    0 讨论(0)
  • 2020-12-04 06:01

    In android studio do the following steps to check the gradle downloaded jar file.

    1. Set project structure view to "Project"
    2. At bottom External library section available, expand it.
    3. Here you can see downloaded jar files.
    0 讨论(0)
  • 2020-12-04 06:05

    If you want your dependency files to be in some specific folder you can simply use a copy task for it. For Eg.

    task copyDepJars(type: Copy) {
      from configurations.compile
      into 'C:\\Users\\athakur\\Desktop\\lib'
    }
    
    0 讨论(0)
  • 2020-12-04 06:07

    I am on windows,

    You should be able find the dependencies inside

    $USER_HOME.gradle\caches\artifacts-24\filestore

    0 讨论(0)
提交回复
热议问题