Gradle 1.0 milestone 9 not in repo


(paulicka) #1

Christophers-MacBook-Pro:jtp-core christopher$ ./gradlew build install Downloading http://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-9-bin.zip

Exception in thread “main” java.io.FileNotFoundException: http://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-9-bin.zip

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1434)

at org.gradle.wrapper.Download.downloadInternal(Download.java:49)

at org.gradle.wrapper.Download.download(Download.java:37)

at org.gradle.wrapper.Install.createDist(Install.java:58)

at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:117)

at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:53) Christophers-MacBook-Pro:jtp-core christopher$ emacs build.gradle

Christophers-MacBook-Pro:jtp-core christopher$ gradle wrapper The ‘urls’ property of the RepositoryHandler.mavenRepo() method is deprecated and will be removed in a future version of Gradle. You should use the ‘url’ property to define the core maven repository & the ‘artifactUrls’ property to define any additional artifact locations.

The problem is that gradle 1.0 milestone 9 isn’t in the repo.gradle.org So we cannot upgrade gradlew to milestone 9


(René Groeschke) #2

Hello Christopher, all you need to do is to update your gradle-wrapper.properties file with the correct distribution URL to the milestone-9 release. A working gradle-wrapper.properties file for m9 can look like this:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-milestone-9-bin.zip

regards, René


(paulicka) #3

Sure…but I don’t have to do that for milestone 5, 6, or 7.

I do have to do it for 8a and 9.

Why?


(paulicka) #4

Plus, gradle-wrapper.properties are generated by the gradle wrapper task. So that change will get blown away the next time I update.

What’s the right way to do this?


(René Groeschke) #5

Hey, now I get the problem. You mean after running the wrapper task you have to manually modify the distribution URL right? This was a possible breaking change in the gradle 1.0-m8 distribution. As noted in the migration guide at http://wiki.gradle.org/display/GRADLE/Gradle+1.0-milestone-8+Migration+Guide#Gradle1.0-milestone-8MigrationGuide-NewURLfordownloadingGradledistributions you have to run the wrapper task with m8 or later to get rid of the manual modification of the distribution url.

I personally prefer to run the wrapper task only once when I introduce the wrapper in my project and remove the wrapper task from my build file after that. For upgrading to a newer version of gradle I just modify the distribution URL in the wrapper properties instead of rerunning the wrapper task.

Hope that helps, regards, René