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

前端 未结 8 1185
忘掉有多难
忘掉有多难 2020-12-23 15:42

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(t         


        
8条回答
  •  一个人的身影
    2020-12-23 16:11

    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.

提交回复
热议问题