DEV Community

Cover image for [Tiny] How to Upgrade Gradle Wrapper
Petr Filaretov
Petr Filaretov

Posted on

12

[Tiny] How to Upgrade Gradle Wrapper

If you are building projects with Gradle, you most likely use Gradle Wrapper. And of course, you will need to update the Gradle version at some point.

One way to do this is to simply change the Gradle version in the gradle-wrapper.properties file, for instance:

distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
Enter fullscreen mode Exit fullscreen mode

But there is a better way.

Use the wrapper Gradle task to upgrade Gradle Wrapper. It not only updates the Gradle version in the gradle-wrapper.properties file, but it also updates the Wrapper shell script (gradlew), the batch file (gradlew.bat), and the Gradle Wrapper jar (gradle-wrapper.jar).

You can run the wrapper task from the terminal, specifying the latest version

./gradlew wrapper --gradle-version latest
Enter fullscreen mode Exit fullscreen mode

or the specific version you want:

./gradlew wrapper --gradle-version 8.1.1
Enter fullscreen mode Exit fullscreen mode

Alternatively, you can add the wrapper task to the build.gradle.kts script

tasks.wrapper {
    gradleVersion = "8.1.1"
}
Enter fullscreen mode Exit fullscreen mode

and run the wrapper task from the Gradle panel in IntelliJ IDEA.


Dream your code, code your dream.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more