Install Gradle Cache Directory?

Is it possible to set the Gradle cache directory without setting the GRADLE_USER_HOME environment variable? I would like the Gradle cache to exist in the same workspace as my code, but it seems that this is only possible with a bash script wrapped around Gradle.

To clarify, I'm talking about the Gradle cache, which contains the allowed dependency files.

+5
source share
1 answer

I think this may be useful for you - Appendix D. Gradle Command Line

--project-cache-dir 

Specifies the cache directory for a specific project. Default value: .gradle in the project root directory.

 --gradle-user-home 

Specifies the home directory of the Gradle user. The default value is .gradle directory in the user's home directory

Excerpt from it in action - just tested locally:

 C:\dev\ws\NYSSIS-Intellij\ear>gradle --gradle-user-home c:\dev\cache-test build Build initialized to use p12_2014_03_31e-windows-models.jar for ChoiceMaker model :compileJava UP-TO-DATE :compileGroovy UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :web:compileJava UP-TO-DATE :web:compileGroovy Download https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/2.4.6/groovy-all-2.4.6.pom Download https://repo1.maven.org/maven2/org/springframework/spring-webmvc/3.2.15.RELEASE/spring-webmvc-3.2.15.RELEASE.pom Download https://repo1.maven.org/maven2/org/springframework/spring-jdbc/3.2.15.RELEASE/spring-jdbc-3.2.15.RELEASE.pom Download https://repo1.maven.org/maven2/org/springframework/spring-context-support/3.2.15.RELEASE/spring-context-support-3.2.15.RELEASE.pom 
+4
source

All Articles