IntelliJ Gradle同步报错:无法解析配置':classpath'的所有构件如何解决?
问题根因
- Spring Boot版本号拼写错误:你配置的
springBootVersion = '2.1.7.REALEASE'存在拼写错误,正确的版本后缀应为RELEASE,字母顺序错误导致公共仓库中找不到对应版本的gradle插件包,这是本次报错的核心原因。 - 依赖声明格式错误: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
相关产品推荐
相关产品推荐

