Spring boot 从Spring Boot 1.5.10迁移到2.0.0时,无法解析依赖项
因此,我将我的基本应用程序从Spring Boot 1.5.10迁移到了2.0.0。我正在使用Gradle,在迁移之前,我总是排除编译依赖项工件的版本号。迁移之后,gradle构建任务开始抛出如下错误:Spring boot 从Spring Boot 1.5.10迁移到2.0.0时,无法解析依赖项,spring-boot,gradle,Spring Boot,Gradle,因此,我将我的基本应用程序从Spring Boot 1.5.10迁移到了2.0.0。我正在使用Gradle,在迁移之前,我总是排除编译依赖项工件的版本号。迁移之后,gradle构建任务开始抛出如下错误: BUILD FAILED in 0s 2 actionable tasks: 1 executed, 1 up-to-date During the build, one or more dependencies that were declared without a version fai
BUILD FAILED in 0s
2 actionable tasks: 1 executed, 1 up-to-date
During the build, one or more dependencies that were declared without a version failed to resolve:
org.springframework.boot:spring-boot-starter-data-rest:
org.springframework.boot:spring-boot-starter-web:
org.springframework.boot:spring-boot-starter-data-jpa:
Did you forget to apply the io.spring.dependency-management plugin to the llutrackr project?
我的build.gradle
(我排除了不相关的部分):
在我将版本号添加到相应的依赖项之后,问题就解决了。为什么要用gradle构建SpringBoot2.0项目就必须进行此更改?甚至spring指南也不包括工件版本号 尝试将以下内容添加到build.gradle文件中
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
应用插件:“io.spring.dependency management”
缺少此行。现在它成功了。谢谢
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'