如何告诉gradlew使用现有的gradle,而不是每次都下载它?

时间:2019-07-10 12:53:06

标签: gradle

对不起,之前没有gradle经验,可以玩https://spring.io/guides/gs/rest-service/

MINGW64 /d/workspace/gs-rest-service/complete (master)
$ ./gradlew bootRun
Downloading https://services.gradle.org/distributions/gradle-4.6-bin.zip

我已经在这里安装了gradle:

MINGW64 ~
$ /d/prefix/gradle-5.5/bin/gradle

> Task :help

Welcome to Gradle 5.5.

To run a build, run gradle <task> ...

To see a list of available tasks, run gradle tasks

To see a list of command-line options, run gradle --help

To see more detail about a task, run gradle help --task <task>

For troubleshooting, visit https://help.gradle.org

BUILD SUCCESSFUL in 599ms
1 actionable task: 1 executed

我如何告诉gradlew使用已安装的版本,而不是每次在任何时候都下载它

1 个答案:

答案 0 :(得分:1)

Gradle wrapper gradlew将始终下载<project>/gradle/wrapper/gradle-wrapper.properties中配置的Gradle的特定版本,如果以前没有下载过该版本的Gradle(并且在~/.gradle/wrapper/dists可用)。原因是该项目应该最了解应该使用哪个版本的Gradle。如果您仍要使用全局安装的Gradle版本,只需将其添加到PATH并调用gradle而不是gradlew