gradle 在哪里保存依赖项的 jars? [英] Where does gradle save dependencies' jars?

查看:37
本文介绍了gradle 在哪里保存依赖项的 jars?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想看看添加依赖时编译的jars/aars.

I want to look at the jars/aars that are compiled when I add dependencies.

例如,如果我在 Gradle 中添加此依赖项,它会将 jar 放在哪里?

For example if I add this dependency in Gradle, where does it put the jar?

dependencies {
    compile 'com.google.android.gms:play-services-analytics:11.0.4'
}

推荐答案

BY DEFAULT

Linux:

~/.gradle/caches/modules-2/files-2.1

视窗:

%USERPROFILE%/.gradle/caches/modules-2/files-2.1

苹果机:

~/.gradle/caches/modules-2/files-2.1

安卓:

no idea... can anyone edit?

开始做其他事情

但是您可以通过设置 GRADLE_USER_HOME 来覆盖这些默认设置.后一个环境变量(如果设置)与 GRADLE_HOME NOT 相同,后者是包含 bin/ 目录的目录的路径,用于您的系统在命令提示符下使用的 Gradle 版本(注意,大多数人似乎没有直接在命令行调用 Gradle,而是使用 Gradle 包装器 但是:$ ./gradlew build).

But you can override these default settings by setting GRADLE_USER_HOME. The latter environment variable, if set, is NOT the same as GRADLE_HOME, which is the path to the directory containing the bin/ directory for the Gradle version your system is using at the command prompt (NB instead of invoking Gradle directly at the command line most people seem to use the Gradle wrapper however: $ ./gradlew build).

在 IDE 中运行 GRADLE

IDE 可能正在使用不同的版本并将依赖项 jar 存储在其他地方.我只知道Eclipse.安装了 Buildship(Eclipse Plug-ins for Gradle")后,要去的地方是 Window --> Preferences --> Gradle.这里有一个框供您指定Gradle 用户主页".我的目前是空的.我认为它正在使用系统 GRADLE_USER_HOME(我确实设置了)......但我没有费心检查:虽然可以从 Eclipse 中运行 Gradle 任务对我来说更方便在单独的终端 (*nix)/命令提示符窗口 ('Doze) 中运行 Gradle 命令.

IDEs may be using a different version and be storing dependency jars somewhere else. I only know Eclipse. Having installed Buildship ("Eclipse Plug-ins for Gradle") the place to go is Window --> Preferences --> Gradle. There is a box here for you to specify "Gradle User Home". Mine is currently empty. I presume it is using the system GRADLE_USER_HOME (which I have indeed set)... but I haven't bothered checking: although it is possible to run Gradle tasks from within Eclipse to me it is more handy to run Gradle commands in a separate Terminal (*nix)/Command Prompt window ('Doze).

这篇关于gradle 在哪里保存依赖项的 jars?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆