Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set gradle cache location?

Tags:

eclipse

gradle

I see the following info in Eclipse package explorer:

enter image description here

Is it possible to change this location?

like image 873
Dims Avatar asked Mar 03 '15 18:03

Dims


People also ask

Where is Gradle build cache located?

The default is the . gradle directory in the user's home directory.

What is Gradle cache directory?

The Gradle Build Cache is designed to help you save time by reusing outputs produced by previous builds. It works by storing (locally or remotely) build outputs, and allowing builds to fetch these outputs from the cache when it determines that inputs have not changed.

Where does Gradle store cache dependencies?

The Gradle dependency cache consists of two storage types located under GRADLE_USER_HOME/caches : A file-based store of downloaded artifacts, including binaries like jars as well as raw downloaded meta-data like POM files and Ivy files.


1 Answers

Globally you can set

[...] Gradle user home directory (defined by the “GRADLE_USER_HOME” environment variable, which [...] defaults to USER_HOME/.gradle) [...]

See also https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_properties_and_system_properties.

Otherwise for every build manually:

-g, --gradle-user-home Specifies the Gradle user home directory. The default is the .gradle directory in the user's home directory.

See https://gradle.org/docs/current/userguide/gradle_command_line.html.

like image 82
Andreas Schmid Avatar answered Oct 01 '22 13:10

Andreas Schmid