Spring Boot版本升级

时间:2020-06-29 22:38:09

标签: java spring-boot

我已将Spring Boot Project更新为最新的Spring Boot Version 2.3.1.RELEASE,但此后,我开始遇到有关依赖项的以下错误-

package org.apache.commons.lang3 does not exist
package org.apache.commons.collections does not exist

我也遇到lombok

错误

我查看了Spring Boot Version 2.3.1.RELEASE发行说明,但未对此进行任何具体更改

更新

我正在从1.5.x to 2.3.1.RELEASE升级

我解决了依赖问题,但现在我面临以下问题

java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:157)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:98)
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:64)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:80)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:53)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:345)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:308)

以下是我的build.gradle依存关系

dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
//compile 'org.springframework.boot:spring-boot-actuator-docs'
compile 'org.springframework.cloud:spring-cloud-starter-feign'
compile 'org.springframework.boot:spring-boot-starter-actuator'
compile 'org.springframework.boot:spring-boot-starter-security'
compile 'org.springframework.cloud:spring-cloud-starter-config'
compile 'org.springframework.cloud:spring-cloud-starter-sleuth'
 compile 'org.springframework.cloud:spring-cloud-starter-hystrix'
 compile 'com.newrelic.agent.java:newrelic-api:4.2.0'
compile 'org.springframework.boot:spring-boot-starter-validation'
compile group: 'org.apache.commons', name: 'commons-lang3', version:   '3.1'
compile group: 'commons-collections', name: 'commons-collections',  version: '3.2.2'

compile 'io.springfox:springfox-swagger-ui:2.6.1'
compile 'io.springfox:springfox-swagger2:2.6.1'
compile 'com.netflix.feign:feign-okhttp:8.18.0'
compile 'com.squareup.okhttp3:okhttp:3.9.0'

compile 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.1'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.1'
compile 'org.springframework.kafka:spring-kafka'
compile ('org.springframework.boot:spring-boot-starter-data-jpa'){
 exclude module : 'org.apache.tomcat:tomcat-jdbc'
}
compile 'org.liquibase:liquibase-core'
compile 'com.h2database:h2'
compile 'org.mariadb.jdbc:mariadb-java-client:2.2.4'
compile 'com.zaxxer:HikariCP:3.4.2'

compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

testCompile 'org.mockito:mockito-core:2.10.0'
testCompile 'org.mockito:mockito-inline:2.10.0'
testCompile 'org.assertj:assertj-core:3.8.0'
testCompile 'io.rest-assured:rest-assured:3.0.3'
testCompile 'com.github.tomakehurst:wiremock-standalone:2.8.0'
testCompile 'org.springframework.boot:spring-boot-starter-  test:2.3.1.RELEASE'
}

0 个答案:

没有答案