redhat-developer / redhat-developer/vscode-java

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

Offen
#3,094 13 Kommentare 7 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
TypeScript
Sterne
2.3k
Forks
546
Ø Merge
20 Std. 1 Min.
Gemergte PRs (30 T.)
11

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginnen Sie damit, das Spring Initializr Gradle-Groovy-Projekt in VS Code mit Debian 11, JDK 17 und der aufgeführten Erweiterungsversion zu reproduzieren. Prüfen Sie, warum der Gradle consumer Java 11 anfordert, während Spring Boot 3.0.6 Java 17 voraussetzt; abgeschlossen ist die Aufgabe, wenn das generierte Projekt ohne den variant-resolution error geöffnet wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java, spring-boot, vscode
Bereich
build-system, developer-experience, tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.