How to avoid download dependencies from mavenCentral everytime jenkins run gradle job

(Woody Wu) #1

Use jenkins to do gradle build always download dependencies from mavenCentral to some tmp/gradle_download folders, thus each time the job run will download again, how can i avoid that?

(Peter Niederwieser) #2

‘tmp/gradle_download’ is just a temporary cache for files that are currently being downloaded, and it shouldn’t cause any problems. The real question is if and why dependencies indeed get downloaded again. That’s not standard Gradle/Jenkins behavior. Some Jenkins plugin versions store dependencies in the build’s workspace, more recent ones in Gradle’s default location (’~/.gradle’).

(Woody Wu) #3

Thanks for the response, I found those responses are stored at ~/.gradle, but where is this configuration is set?

(Peter Niederwieser) #4

You can change the location by setting the ‘GRADLE_USER_HOME’ environment variable.