IntelliJ包含旧版本的Gradle

时间:2020-10-06 17:03:03

标签: intellij-idea

我已经在Windows计算机上的IntelliJ IDEA中创建了具有Gradle支持的Spring Initializr项目。当向导完成后,我得到了错误:

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\java_test\crudwithvaadin\build.gradle' line: 2

* What went wrong:
An exception occurred applying plugin request [id: 'org.springframework.boot', version: '2.3.4.RELEASE']
> Failed to apply plugin [id 'org.springframework.boot']
   > Spring Boot plugin requires Gradle 5 (5.6.x only) or Gradle 6 (6.3 or later). The current version is Gradle 5.2.1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

这是否意味着IntelliJ包含旧版本的Gradle?该如何解决?

1 个答案:

答案 0 :(得分:1)

检查gradle-wrapper.properties文件包含的内容,例如:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip

Preferences> Build, Execution, Deployment > Gradle下,您会找到可能设置为gradle-wrapper.properties的默认设置。您可以将其更改为特定版本的gradle。

enter image description here

还要检查How to change the version of the 'default gradle wrapper' in IntelliJ IDEA?https://www.jetbrains.com/help/idea/gradle.html#gradle_settings_access