Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the version of the 'default gradle wrapper' in IntelliJ IDEA?

I want to use Gradle 1.10 instead of 1.9. I cannot seem to find where to change this.

If I put this:

task wrapper(type: Wrapper) {     gradleVersion = '1.10' } 

in my build.gradle and rebuild, it is built with Gradle 1.9 again (so nothing actually happens).

These seem to be all the settings: (and IntelliJ's help section about Gradle doesn't help at all :( ) What does "not configured for the current" project mean?

like image 600
Bloke Avatar asked Aug 08 '14 13:08

Bloke


People also ask

How do I change the Gradle wrapper version?

Method 1. Then just click on Build, Execution, Deployment Tab Build → Tools → Gradle → Use default Gradle wrapper (recommended) option. Step 2: Selecting desired Gradle version. Then click on the Project option.

How do I change my default Gradle version?

The easiest way to update the gradle in the intellij is, to remove the existing gradle folder in the project and automatically intellij will download the latest. For instance I had 6.41 as the downloaded version. I just removed this gradle folder and it automatically downloaded to 7.1.

How do I downgrade Gradle Wrapper version?

If you want to up or downgrade the Gradle wrapper, you can execute the command gradle wrapper --gradle-version X.Y .

How do I know my Gradle Wrapper version?

In Android Studio, go to File > Project Structure. Then select the "project" tab on the left. Your Gradle version will be displayed here. If you are using the Gradle wrapper, then your project will have a gradle/wrapper/gradle-wrapper.


2 Answers

The easiest way is to execute the following command from the command line (see Upgrading the Gradle Wrapper in documentation):

./gradlew wrapper --gradle-version 5.5 

Moreover, you can use --distribution-type parameter with either bin or all value to choose a distribution type. Use all distribution type to avoid a hint from IntelliJ IDEA or Android Studio that will offer you to download Gradle with sources:

./gradlew wrapper --gradle-version 5.5 --distribution-type all 

Or you can create a custom wrapper task

task wrapper(type: Wrapper) {     gradleVersion = '5.5' } 

and run ./gradlew wrapper.

like image 157
Michael Avatar answered Sep 22 '22 20:09

Michael


Open the file gradle/wrapper/gradle-wrapper.properties in your project. Change the version in the distributionUrl to use the version you want to use, e.g.,

distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip 
like image 31
Aperifons Avatar answered Sep 22 '22 20:09

Aperifons