java gradle 在哪里保存依赖项的 jars?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46832288/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 09:22:14  来源:igfitidea点击:

Where does gradle save dependencies' jars?

javaandroidandroid-studiogradleandroid-gradle-plugin

提问by Doron Yakovlev-Golani

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

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

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

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

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

采纳答案by nhoxbypass

Open your Android Studio Project Explorer, expand External Librariessections. Right click and Show in Files/Explorer

打开您的 Android Studio Project Explorer,展开External Libraries部分。右键单击并Show in Files/Explorer

回答by FabioLux

Generally, you can find in:

通常,您可以在以下位置找到:

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

回答by mike rodent

BY DEFAULT

默认情况下

Linux:

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

设置为其他东西

But you can override these default settings by setting GRADLE_USER_HOME. The latter environment variable, if set, is NOTthe 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 wrapperhowever: $ ./gradlew build).

但是您可以通过设置来覆盖这些默认设置GRADLE_USER_HOME。后者的环境变量,如果设置,是一样的GRADLE_HOME,这是路径包含的目录bin/为您的系统在命令提示符下使用摇篮版本目录(而不是直接在命令行中调用摇篮NB大多数人似乎但是要使用Gradle 包装器:)$ ./gradlew build

RUNNING GRADLE IN AN IDE

在 IDE 中运行 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).

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