我正在运行此 Spring 错误报告中描述的确切问题。
https://jira.spring.io/browse/SPR-16149
Juergen Hoeller已修复该错误。他的评论:
The current 5.0.2.BUILD-SNAPSHOT contains this revision in the meantime. I'll backport it to 4.3.13 by Monday.
太棒了,但是在使用spring-boot-starter时如何更新spring版本?以下是我的gradle文件,其中没有指向 Spring 版本的链接。这是由我的Spring Boot版本处理的吗? spring starter项目是否设置并安装了特定的spring版本,或者它们只是使用最新版本?
buildscript {
ext {
springBootVersion = '1.5.7.RELEASE'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
group = 'company.'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
maven {
url 'https://repo.spring.io/libs-milestone'
}
}
dependencyManagement {
imports {
mavenBom 'org.springframework.cloud:spring-cloud-stream-dependencies:Elmhurst.M2'
}
}
dependencies {
compile("org.springframework.boot:spring-boot-starter")
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile("org.springframework.cloud:spring-cloud-starter-stream-rabbit")
compile(group: 'org.modelmapper', name: 'modelmapper', version: '0.7.5')
compile("io.springfox:springfox-swagger2:2.7.0")
compile('io.springfox:springfox-swagger-ui:2.7.0')
testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile "org.mockito:mockito-core:2.+"
runtime group: 'com.h2database', name: 'h2', version: '1.0.60'
// runtime("mysql:mysql-connector-java")
}
在此先感谢您的帮助。
最佳答案
有一些项目特定的属性,如here所定义。您可以覆盖gradle / pom中的属性,以覆盖正在使用的版本。
我猜它应该也是如此。
更新:
我的项目pom.xml将具有所有依赖关系以及以下内容:
<properties>
<thymeleaf.version>3.0.8.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>2.2.2</thymeleaf-layout-dialect.version>
</properties>
这将允许我的应用程序在Spring Boot 1.5。*仍随附的情况下使用Thymeleaf 3:
<thymeleaf.version>2.1.5.RELEASE</thymeleaf.version>
<thymeleaf-layout-dialect.version>1.4.0</thymeleaf-layout-dialect.version>
因此,您应该能够在Gradle(定义属性的地方)中执行类似的操作。
关于java - 在Spring Boot中更新基础Spring版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47134747/