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

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

问题描述

我想看看添加依赖项时编译的jar/aar.

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

Windows:

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

Mac:

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

Android:

no idea... can anyone edit?

设置其他内容

SETTING TO SOMETHING ELSE

但是您可以通过设置GRADLE_USER_HOME覆盖这些默认设置.如果设置了后者,则环境变量 NOT GRADLE_HOME相同,后者是目录的路径,该目录包含系统在命令提示符下使用的Gradle版本的bin/目录(注意,大多数人似乎不是在命令行直接调用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中运行渐变

RUNNING GRADLE IN AN IDE

IDE可能正在使用其他版本,并在其他位置存储依赖项jar.我只知道Eclipse.安装了Buildship(用于Gradle的Eclipse插件")后,可以找到Window-> Preferences-> Gradle.这里有一个框供您指定"Gradle User Home".我的是空的.我想它正在使用系统GRADLE_USER_HOME(我已经设置好了)...但是我没有费心检查:尽管可以从Eclipse内部运行Gradle任务到我,但是在其中运行Gradle命令更方便一个单独的终端(* nix)/命令提示符窗口(打ze").

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在哪里保存依赖项的jar?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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