redhat-developer / redhat-developer/vscode-java

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

未关闭
#3,094 13 条评论 7 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
TypeScript
星标
2.3k
派生
547
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,在 Debian 11、JDK 17 和列出的扩展版本下,于 VS Code 中复现 Spring Initializr Gradle-Groovy 项目。检查为什么 Gradle consumer 请求 Java 11,而 Spring Boot 3.0.6 要求 Java 17;当生成的项目能够在没有 variant-resolution error 的情况下打开时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, spring-boot, vscode
领域
build-system, developer-experience, tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。