[JAVA] Update to the latest version without specifying the version with gradle wrapper

Basically, the Gradle version is fixed with a wrapper. If you want to change it, check the version at https://services.gradle.org/distributions/ and manually rewrite gradleVersion and gradle-wrapper.properties. .. .. No, no, I always want to get the latest version! For those who say.

build.gradle


import groovy.json.JsonSlurper

wrapper {
    doFirst {
        def versionService = new URL('https://services.gradle.org/versions/current')
        gradleVersion = new JsonSlurper().parseText(versionService.text).version
        print("gradleVersion: " + gradleVersion)
    }
}

Run


gradlew wrapper

It's a bit gritty, but now you can update the Gradle wrapper to the latest version without specifying the version, and you can check the updated version in gradle / wrapper / gradle-wrapper.properties. If you need all.zip instead of bin.zip, such as in IntelliJ, specify distributionType = Wrapper.DistributionType.ALL.

For those who don't even want to run the wrapper task, dependsOn.

Recommended Posts

Update to the latest version without specifying the version with gradle wrapper
AWS Cloud9 environment construction Update Ruby to the latest stable version
Update JAVA to the latest version to 1.8.0_144 (when downloading from the web and updating)
How to update with activerecord-import
How to add elements without specifying the length of the array
What to do if the app is not created with the latest Rails version installed when rails new
What to do if validation doesn't work with the update action
How to use the wrapper class
I want to introduce the committee with Rails without getting too dirty
A story about sending a pull request to MinGW to update the libgr version
Add scripts to distributions created with gradle
Easy JSON database experience with Docker ~ Try the latest version of Couchbase Server
How to check the latest version of io.spring.platform to describe in pom.xml of Spring (STS)
repository The specified gem is bundle installed but not updated to the latest version
Send a notification to slack with the free version of sentry (using lambda)