Kotlin 17 spring boot 3 build fail problem

In kotlin jdk 17, spring boot 3.0.2

The plugin version is id(“org.sonarqube”) version “4.0.0.2929”
and when executing the below command

./gradlew sonarqube
-Dsonar.projectKey=PROJECTKEY
-Dsonar.host.url=URL
-Dsonar.login=TOKEN

Build failure occurs.

The result of building is as follows.

Could not resolve all files for configuration ‘:classpath’.
> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.2.
Required by:
project: > org.springframework.boot:org.springframework.boot.gradle.plugin:3.0.2
> No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.2 was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute ‘org.gradle.plugin.api-version’ with value ‘7.6’

I searched for the problem and couldn’t find it, so I’m asking.
Please check and reply.

Hey there.

Does the build work with Java 11, or without the sonarqube task (just gradle build)?

i solved this.
The reason was that JAVA versions 11, 17, and 19 were installed, but the main JAVA_HOME was set to 11.
thank you

1 Like