“No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.5 was found.”

huangapple go评论53阅读模式
英文:

No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.5 was found

问题

I updated the springboot version 2.7.9 to 3.0.5 in build.gradle and not able to build project, it says:

> No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.5 was found. The consumer was configured to find a runtime of a library compatible with Java 14, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.4.2' but:

  • Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.5 declares a library, packaged as a jar, and its dependencies declared externally:
  • Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 14.

I've also tried to change java version from 17 to 14 but still getting the same error.

英文:

I updated the springboot version 2.7.9 to 3.0.5 in build.gradle and not able to build project, it says

  > No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.5 was found. The consumer was configured to find a runtime of a library compatible with Java 14, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.4.2' but:
      - Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.5 declares a library, packaged as a jar, and its dependencies declared externally:
          - Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 14.

I've also tried to changed java version from 17 to 14 but still getting same.

答案1

得分: 0

请确保您使用Java 17或更高版本来运行Gradle。

如果通过命令行运行构建,请检查java -version

如果通过IDE(例如,IDEA)运行构建,请确保您的IDE使用正确的Java版本。例如,对于IDEA,可以在“设置 -> 构建,执行,部署 -> Gradle -> Gradle JVM”中完成。

英文:

You need to ensure you run gradle with java 17 or higher.

If you run build via the command line, please check java -version

If you run a build via IDE (for example, IDEA), ensure your IDE uses the correct Java. For example, for IDEA it can be done in Settings -> Build,execution,deployment -> Gradle -> Gradle JVM

“No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.5 was found.”

huangapple
  • 本文由 发表于 2023年5月17日 21:53:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/76272896.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定