Move gradle temporary cache dir to other directory
Asked Answered
C

2

5

I have some trouble with the temporary gradle cache directory. Gradle downloads all dependencies at first to /tmp/gradle_download...bin before it moves them to their target directory.

10:55:12.932 [DEBUG] [org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor] Downloading https://${myNexusURL}/nexus/content/groups/../myArtefact.zip to /tmp/gradle_download1430290155040442921bin

Our space on /tmp is very limited but on other directories we have enough space. Is there a way to change that directory?

./gradlew -version

------------------------------------------------------------
Gradle 3.0
------------------------------------------------------------

Build time:   2016-08-15 13:15:01 UTC
Revision:     ad76ba00f59ecb287bd3c037bd25fc3df13ca558

Groovy:       2.4.7
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_91 (Oracle Corporation 25.91-b14)
OS:           Linux 3.0.101-0.40-default amd64

Thanks for help

Cappuccino answered 20/6, 2017 at 9:9 Comment(0)
K
7

As mentioned by the OP in his own answer, the temporary directory used by Gradle can be set via the java.io.tmpdir system property. Maybe the following is obvious but just in case: you can also configure this system property with an environment variable for Gradle so that you don’t have to separately configure it with each Gradle call.

For example, you could add the following to your .bashrc:

export GRADLE_OPTS=-Djava.io.tmpdir=/path/to/tmpdir

GRADLE_OPTS should be recognized by both gradle and the Gradle Wrapper (gradlew).

Karmen answered 12/1, 2018 at 12:39 Comment(0)
C
1

Solving it via -Djava.io.tmpdir=/path/to/tmpdir

Cappuccino answered 22/6, 2017 at 10:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.