How to set gradle cache location?

I see the following information in the Eclipse package explorer:

enter image description here

Can I change this location?

+15
eclipse gradle
source share
4 answers

Globally, you can install

[...] Gradle user's home directory (defined by the environment variable "GRADLE_USER_HOME", which [...] is by default used by USER_HOME / .gradle) [...]

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

Otherwise, for each assembly manually:

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

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

+24
source share

You can change the location of the gradle cache location in eclipse by setting the eclipse gradle preference

In Eclipse open, window-> preferences Search for 'Gradle' set 'Gradle User Home' to your chosen location Click Apply / ok

Now, for the changes to take effect, you may need to do Gradle -> Update gradle Project

+2
source share

You cannot change the cache location specifically, but you can change the Gradle user’s home directory (.gradle directory) to which the cache is located using the -g command line argument.

+1
source share

You can change the location of the cache starting with version 3.5. This is controlled in the settings.gradle file for your project:

 buildCache { local { // Set local build cache directory. directory = "${settingsDir}/build-cache" } } 

thanks to Hubert Klein Ikkink, also known as mhaki .

0
source share

All Articles