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
In Windows 10 PC, it is saved at:
C:\Users\<user>\.gradle\caches\modules-2\files-2.1\
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.
In case it is an Android gradle project - you can find the android libraries below your $ANDROID_HOME/extras/android/m2repository folder
In android studio do the following steps to check the gradle downloaded jar file.
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'
}
I am on windows,
You should be able find the dependencies inside
$USER_HOME.gradle\caches\artifacts-24\filestore