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

前端 未结 8 1168
忘掉有多难
忘掉有多难 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条回答
  •  Happy的楠姐
    2020-12-23 16:34

    The 'wrapper' task in gradle is called if gradlew command is used, if you use gradle command to build the wrapper task is not called. So, there are two ways you can change your gradle version.

    1. Use 'gradlew build' command, this command will call the wrapper task that you mentioned. That task will change the 'distributionUrl' parameter in gradle-wrapper.properties file and it will automatically download the gradle version you want. Example distributionUrl in the file for version 4.2. distributionUrl=https://services.gradle.org/distributions/gradle-4.2-bin.zip

    2. If you are not using gradle wrapper simply download the version of the gradle you want and set environment variable path and also show it to IDEA.

    P.S. for more information about gradle wrapper I suggest you to read: https://docs.gradle.org/current/userguide/gradle_wrapper.html

提交回复
热议问题