Gradle store on local file system

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

    I just stumbled onto this while searching for this answer. If you are using intellij, you can navigate to the file location, but opening the external lib folder in the project explorer, right clicking on the jar, and select Open Library Settings.

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

    On Mac, Linux and Windows i.e. on all 3 of the major platforms, Gradle stores dependencies at:

    ~/.gradle/caches/modules-2/files-2.1
    
    0 讨论(0)
  • 2020-12-04 06:14

    Gradle's local repository folder is:

    • $USER_HOME/.gradle/caches/modules-2/files-2.1

    Defined dependencies will be loaded from remote repositories into gradle's local repository folder. For each loaded file, gradle will be create a new folder named with md5 value of the original file (pom,jar,..). Full path for the dependency file is made up from :

    • groupid + artifactid + version + FILE_MD5_VALUE + FILE_NAME

    If our defined dependency is:

    • compile 'org.springframework:spring-jdbc:4.3.4.RELEASE'

    Then the library will be loaded into :

    • /$USER_HOME/.gradle/caches/modules-2/files-2.1/org.springframework/spring-jdbc/4.3.4.RELEASE/42175d194cf6aa7c716c0887f30255e5c0a5262c/spring-jdbc-4.3.4.RELEASE.jar
    0 讨论(0)
  • 2020-12-04 06:14

    On my windows machine with "Buildship 2.0.2" plugin installed in eclipse, dependencies are stored :

    $USER_HOME.gradle\caches\modules-2\files-2.1

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

    For my case, I was using an Ivy repository, and my Gradle dependencies were stored in ~/.ivy2/.

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

    In fact the cache location depends on the GRADLE_USER_HOME environment variable value. By default, it is $USER_HOME/.gradle on Unix-OS based and %userprofile%.\gradle on Windows.
    But if you set this variable, the cache directory would be located from this path.

    And whatever the case, you should dig into caches\modules-2\files-2.1 to find the dependencies.

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