Gradle store on local file system

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

    It took me a while to realize this, hence the additional answer. Hopefully it can save folks time. Note that if you are running sudo gradle the dependencies may not be in your home directory, even if sudo echo $HOME returns /Users/<my-non-root-user>/. On my Mac, Gradle was caching the dependencies in /private/var/root/.gradle/caches/.

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

    You can use the gradle argument --project-cache-dir "/Users/whatever/.gradle/" to force the gradle cache directory.

    In this way you can be darn sure you know what directory is being used (as well as create different caches for different projects)

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

    Many answers are correct! I want to add that you can easily find your download location with

    gradle --info build
    

    like described in https://stackoverflow.com/a/54000767/4471199.

    New downloaded artifacts will be shown in stdout:

    Downloading https://plugins.gradle.org/m2/org/springframework/boot/spring-boot-parent/2.1.7.RELEASE/spring-boot-parent-2.1.7.RELEASE.pom to /tmp/gradle_download551283009937119777bin
    

    In this case, I used the docker image gradle:5.6.2-jdk12. As you can see, the docker container uses /tmp as download location.

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