Gradle 3.0, Win10 64x, Oracle JDK 1.8 64x - version is not filled in correctly in generated gradle-wrapper.properties file

not-a-bug

(sirinath1978m) #1

I am getting the following exception due to the gradle-wrapper.properties always getting corrupted since class org.gradle.util.GradleVersion is inserted in place of Gradle version.

Exception in thread "main" java.lang.RuntimeException: Could not load wrapper properties from 'C:\Users\HP\IdeaProjects\Collections\gradle\wrapper\gradle-wrapper.properties'.
        at org.gradle.wrapper.WrapperExecutor.<init>(WrapperExecutor.java:64)
        at org.gradle.wrapper.WrapperExecutor.forWrapperPropertiesFile(WrapperExecutor.java:47)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:60)
Caused by: java.net.URISyntaxException: Illegal character in path at index 54: https://services.gradle.org/distributions/gradle-class org.gradle.util.GradleVersion-all.zip
        at java.net.URI$Parser.fail(URI.java:2848)
        at java.net.URI$Parser.checkChars(URI.java:3021)
        at java.net.URI$Parser.parseHierarchical(URI.java:3105)
        at java.net.URI$Parser.parse(URI.java:3053)
        at java.net.URI.<init>(URI.java:588)
        at org.gradle.wrapper.WrapperExecutor.readDistroUrl(WrapperExecutor.java:81)
        at org.gradle.wrapper.WrapperExecutor.prepareDistributionUri(WrapperExecutor.java:70)
        at org.gradle.wrapper.WrapperExecutor.<init>(WrapperExecutor.java:57)
        ... 2 more

Final property file looks like:

#Sat Sep 03 12:34:09 IST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-class org.gradle.util.GradleVersion-all.zip

Also following task is defined:

task wrapper(type: Wrapper) {
    gradleVersion = '3.0'
    distributionUrl = "https://services.gradle.org/distributions/gradle-$GradleVersion-all.zip"
}

OS: Win 10 64x
Gradle: 3.0
JDK: Oracle 1.8 64x


(Chris Doré) #2

Use lower case g in the URL.

$gradleVersion instead of $GradleVersion

Lower case accesses the property, uppercase is grabbing a class.