When I execute “gradlew.bat run” the first thing Gradle does it attempt to download itself. I have already successfully installed Gradle and even used the task “wrapper” to create the gradlew.bat script. I have GRADLE_HOME set as well (obviously otherwise “gradle -v” would not execute). I am using gradle version 2.1. In chapter 62.1 (http://www.gradle.org/docs/2.1/userguide/userguide_single.html#sec:configuration) of the Gradle User Guide it says “If you run Gradle with gradlew, the wrapper checks if a Gradle distribution for the wrapper is available. If so, it delegates to the gradle command of this distribution with all the arguments passed originally to the gradlew command. If it didn’t find a Gradle distribution, it will download it first.” My questions is why, since I have the appropriate version of Gradle installed, does it attempt to download itself? Please see the below for the details of my steps and setup.
C:\directories>dir
Volume in drive C has no label.
Volume Serial Number is ***
Directory of C:\directories
10/31/2014 10:41 AM
. 10/31/2014 10:41 AM
… 10/31/2014 10:40 AM
313 build.gradle 10/29/2014 08:42 AM
src
1 File(s)
313 bytes
3 Dir(s) 42,502,537,216 bytes free
C:\directories>gradle build :compileJava :processResources UP-TO-DATE :classes :jar :assemble :compileTestJava UP-TO-DATE :processTestResources UP-TO-DATE :testClasses UP-TO-DATE :test UP-TO-DATE :check UP-TO-DATE :build
BUILD SUCCESSFUL
Total time: 6.066 secs C:\directories>gradle wrapper :wrapper
BUILD SUCCESSFUL
Total time: 5.173 secs C:\directories>dir
Volume in drive C has no label.
Volume Serial Number is ***
Directory of C:\directories
10/31/2014 10:41 AM
. 10/31/2014 10:41 AM
… 10/31/2014 10:41 AM
.gradle 10/31/2014 10:41 AM
build 10/31/2014 10:40 AM
313 build.gradle 10/31/2014 10:41 AM
gradle 10/31/2014 10:41 AM
5,080 gradlew 10/31/2014 10:41 AM
2,404 gradlew.bat 10/29/2014 08:42 AM
src
3 File(s)
7,797 bytes
6 Dir(s) 42,502,631,424 bytes free
C:\directories>gradle -v
------------------------------------------------------------ Gradle 2.1 ------------------------------------------------------------
Build time:
2014-09-08 10:40:39 UTC Build number: none Revision:
e6cf70745ac11fa943e19294d19a2c527a669a53
Groovy:
2.3.6 Ant:
Apache Ant™ version 1.9.3 compiled on December 23 2013 JVM:
1.8.0 (Oracle Corporation 25.0-b70) OS:
Windows 7 6.1 amd64
C:\directories>more build.gradle apply plugin: ‘java’
apply plugin: ‘application’ mainClassName = ‘hello.HelloWorld’
repositories {
mavenLocal()
mavenCentral() }
dependencies {
compile “joda-time:joda-time:2.2” }
jar {
baseName = ‘gs-gradle’
version = ‘0.1.0’ }
task wrapper(type: Wrapper) {
gradleVersion = ‘2.1’ }
C:\directories>gradlew.bat run Downloading https://services.gradle.org/distributions/gradle-2.1-bin.zip …Terminate batch job (Y/N)? y
C:\directories>