【发布时间】:2018-08-11 13:33:45
【问题描述】:
所以,我将我的基本应用程序从 Spring Boot 1.5.10 迁移到了 2.0.0。我正在使用 Gradle,在迁移之前,我总是排除编译依赖项的工件的版本号。迁移后,gradle build task 开始抛出如下错误:
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(我排除了不相关的部分):
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.0.0.RELEASE")
}
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-data-rest")
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-starter-web')
}
我给对应的依赖加上版本号后,问题就解决了。为什么使用 gradle 构建 Spring Boot 2.0 项目需要进行此更改?即使是弹簧指南也不包括工件版本号。 An example
【问题讨论】:
标签: spring-boot gradle