I am learning to use git and gradle to build Spring 3.2 on my local system.
I cloned the git repo and used the gradlew command to start the build like so:
gradlew build
I also have the GRADLE_HOME set up and added GRADLE_HOME/bin to my PATH variable.
Every time I start up the build I see a .gradle directory being created in my directory C:\Users\Ayusman and it seems to download gradle binaries.
My questions:
- Since I already have gradle installed on my system; why does it have to download gradle?
- Can I force gradle to put my dependencies in a specific directory instead of the users folder (like I can specify in maven)?
- Can gradle be pointed to pull from a local repo instead of internet?
ad 1. In order to build with your locally installed Gradle, you have to invoke
gradlerather thangradlew. The purpose ofgradlew(called the Gradle Wrapper) is for everybody to use the same Gradle version and not having to install Gradle manually.ad 2. To change where Gradle puts dependencies (and other global information), you can set the
GRADLE_USER_HOMEenvironment variable.ad 3. You just need to add another repository declaration to
build.gradle. Something like:If you want to use this repository for all your builds, you can put the same declaration into
~/.gradle/init.gradle.