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

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?

‘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’).

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

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