You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

IntelliJ Gradle同步报错:无法解析配置':classpath'的所有构件如何解决?

问题根因
  1. Spring Boot版本号拼写错误:你配置的springBootVersion = '2.1.7.REALEASE'存在拼写错误,正确的版本后缀应为RELEASE,字母顺序错误导致公共仓库中找不到对应版本的gradle插件包,这是本次报错的核心原因。
  2. 依赖声明格式错误:dependencies代码块中,spring-boot-starter-web和spring-boot-starter-test的末尾多了不必要的冒号,也会触发后续依赖拉取异常。
修复方案
  • 修正build.gradle中springBootVersion的拼写:
    将springBootVersion = '2.1.7.REALEASE'改为springBootVersion = '2.1.7.RELEASE'
  • 修正dependencies代码块的依赖声明,删除末尾多余的冒号:
dependencies {
    compile('org.springframework.boot:spring-boot-starter-web')
    testCompile('org.springframework.boot:spring-boot-starter-test')
}
  • 完成修改后重新执行Gradle Sync操作即可正常构建项目。

内容的提问来源于stack exchange,提问作者sung taek oh

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.07 05:12:00