redhat-developer / redhat-developer/vscode-java

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

Open
#3,094 13 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

Error when opening a new Java project generated via Spring Initializr.

Environment
  • Operating System: Debian 11
  • JDK version: JDK 17
  • Visual Studio Code version: 1.67.2
  • Java extension version: 1.18.0
Steps To Reproduce
  1. Go to https://start.spring.io/
  2. Generate a project with defaults:

Project: Gradle - Groovy
Language: Java
Spring Boot: 3.0.6
Packaging: Jar
Java: 17

[Please attach a sample project reproducing the error]
Please attach logs

Current Result

`The supplied phased action failed with an exception.
A problem occurred configuring root project 'todos'.
Could not resolve all files for configuration ':classpath'.
Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.6.
Required by:
project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.0.6
No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.6 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.1' but:

  • Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.6 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 11
    • Other compatible attribute:
      • Doesn't say anything about org.gradle.plugin.api-version (required '7.6.1')
  • Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.6 declares a runtime of a component, and its dependencies declared externally:
    • Incompatible because this component declares documentation and the consumer needed a library
    • Other compatible attributes:
      • Doesn't say anything about its target Java version (required compatibility with Java 11)
      • Doesn't say anything about its elements (required them packaged as a jar)
      • Doesn't say anything about org.gradle.plugin.api-version (required '7.6.1')
  • Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.0.6 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 11
    • Other compatible attribute:
      • Doesn't say anything about org.gradle.plugin.api-version (required '7.6.1')
  • Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.0.6 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
    • Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 11
    • Other compatible attribute:
      • Doesn't say anything about org.gradle.plugin.api-version (required '7.6.1')
  • Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.6 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
    • Incompatible because this component declares a component compatible with Java 17 and the consumer needed a component compatible with Java 11
    • Other compatible attribute:
      • Doesn't say anything about org.gradle.plugin.api-version (required '7.6.1')
  • Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.6 declares a runtime of a component, and its dependencies declared externally:
    • Incompatible because this component declares documentation and the consumer needed a library
    • Other compatible attributes:
      • Doesn't say anything about its target Java version (required compatibility with Java 11)
      • Doesn't say anything about its elements (required them packaged as a jar)
      • Doesn't say anything about org.gradle.plugin.api-version (required '7.6.1')`
Expected Result

No error while running Spring Boot projects generated by Spring Initializr. This works on other IDE's.

Additional Informations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Spring Initializr Gradle-Groovy project in VS Code with Debian 11, JDK 17, and the listed extension version. Check why the Gradle consumer requests Java 11 while Spring Boot 3.0.6 requires Java 17; done means the generated project opens without the variant-resolution error.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot, vscode
Domain
build-system, developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.