简体   繁体   English

获取 Spring Boot [2.7.0] is not compatible with this Spring Cloud release train 错误

[英]getting Spring Boot [2.7.0] is not compatible with this Spring Cloud release train error

I am new to spring.我是春天的新手。

I was trying to upgrade spring boot version from 2.3.3.RELEASE to 2.6.7 in existing spring batch project.我试图在现有的 Spring Batch 项目中将 Spring Boot 版本从2.3.3.RELEASE升级到2.6.7

Project build completed successfully but I am getting bellow error when I run batch.项目构建成功完成,但运行批处理时出现以下错误。 Please help.请帮忙。

***************************
APPLICATION FAILED TO START
***************************

Description:

Your project setup is incompatible with our requirements due to following reasons:

- Spring Boot [2.6.7] is not compatible with this Spring Cloud release train

Action:
Consider applying the following actions:
- Change Spring Boot version to one of the following versions [2.3.x, 2.4.x] .
You can find the latest Spring Boot versions here [https://spring.io/projects/spring-boot#learn]. 
If you want to learn more about the Spring Cloud Release train compatibility, you can visit this page [https://spring.io/projects/spring-cloud#overview] and check the [Release Trains] section.
If you want to disable this check, just set the property [spring.cloud.compatibility-verifier.enabled=false]

My current code of build.gradle is as below,我当前的build.gradle代码如下,

buildscript {
    ext {
        springBootVersion = '2.6.7'
    }
}
plugins {
    id 'org.springframework.boot' version "${springBootVersion}"
}

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

sourceCompatibility = 11

tasks.named("bootJar") {
    archiveFileName = "${archiveBaseName.get()}.${archiveExtension.get()}"
    mainClass = 'jp.co.BatchApplication'
}

jar.archiveFileName = bootJar.archiveFileName

repositories {
    mavenCentral()
}

dependencies {
    implementation("org.springframework.boot:spring-boot-starter-batch:${springBootVersion}")
    implementation("org.springframework.boot:spring-boot-starter-web:${springBootVersion}")
    implementation("org.springframework.boot:spring-boot-starter-thymeleaf:${springBootVersion}")
    implementation("org.springframework.boot:spring-boot-starter-aop:${springBootVersion}")
    implementation("org.springframework.retry:spring-retry:1.2.5.RELEASE")
    implementation("org.projectlombok:lombok:1.18.24")
    annotationProcessor("org.projectlombok:lombok:1.18.24")
    implementation('mysql:mysql-connector-java:8.0.17')
    implementation('org.seasar.doma.boot:doma-spring-boot-starter:1.4.0')
    annotationProcessor('org.seasar.doma:doma-processor:2.35.0')
    implementation('org.apache.commons:commons-lang3:3.11')
    implementation('org.apache.commons:commons-collections4:4.4')
    implementation('com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.11.2')
    implementation("javax.xml.bind:jaxb-api:2.3.1")
    
    implementation(fileTree(dir: 'lib', include: ['*.jar']))
    implementation("org.hibernate.validator:hibernate-validator:6.1.5.Final")
    implementation('org.apache.httpcomponents:httpclient:4.5.12')
    // for r3-id-1.0.1.jar
    implementation('commons-digester:commons-digester:2.1')
    // Azure App Configuration
    implementation('com.microsoft.azure:spring-cloud-azure-appconfiguration-config-web:1.3.0')
    implementation('com.microsoft.azure:spring-cloud-azure-feature-management-web:1.3.0')

    testImplementation("org.springframework.boot:spring-boot-starter-test:${springBootVersion}")
    
}

*
*
*
*

I guess it is not relevant to this error but I have also change DefaultBatchConfigurer class from use of MapJobRepositoryFactoryBean to JobRepositoryFactoryBean.我想这与这个错误无关,但我也将 DefaultBatchConfigurer 类从使用 MapJobRepositoryFactoryBean 更改为 JobRepositoryFactoryBean。 As MapJobRepositoryFactoryBean is deprecated.由于 MapJobRepositoryFactoryBean 已被弃用。

The error is quite explanatory ...该错误非常解释...

- Spring Boot [2.6.7] is not compatible with this Spring Cloud release train

Spring Cloud versions are tied to specific Spring Boot versions . Spring Cloud 版本与特定的 Spring Boot 版本相关联 When using Spring Cloud you cannot just upgrade Spring Boot you also need to upgrade Spring Cloud to a version that supports that Spring Boot version.使用 Spring Cloud 时,您不能只升级 Spring Boot,还需要将 Spring Cloud 升级到支持该 Spring Boot 版本的版本。

As you are using some Azure Cloud dependencies you need to upgrade those to a newer version (if available) that support a Spring Cloud version that supports Spring Boot 2.6.当您使用一些 Azure Cloud 依赖项时,您需要将它们升级到支持 Spring Boot 2.6 的 Spring Cloud 版本的更新版本(如果可用)。

Pro Tip I would also suggest to cleanup your dependencies so you benefit, more, from the Spring Boot dependency management专业提示我还建议清理您的依赖项,以便您从 Spring Boot 依赖项管理中受益更多

dependencies {
    implementation("org.springframework.boot:spring-boot-starter-batch")
    implementation("org.springframework.boot:spring-boot-starter-web")
    implementation("org.springframework.boot:spring-boot-starter-thymeleaf")
    implementation("org.springframework.boot:spring-boot-starter-aop")
    implementation("org.springframework.boot:spring-boot-starter-validation")
    implementation("org.springframework.retry:spring-retry")
    implementation("org.projectlombok:lombok")
    annotationProcessor("org.projectlombok:lombok")
    implementation('mysql:mysql-connector-java')
    implementation('org.seasar.doma.boot:doma-spring-boot-starter:1.4.0')
    annotationProcessor('org.seasar.doma:doma-processor:2.35.0')
    implementation('org.apache.commons:commons-lang3:3.11')
    implementation('org.apache.commons:commons-collections4:4.4')
    implementation('com.fasterxml.jackson.dataformat:jackson-dataformat-xml')
    implementation("javax.xml.bind:jaxb-api")
    // for Mu Client
    implementation(fileTree(dir: 'lib', include: ['*.jar']))
    implementation('org.apache.httpcomponents:httpclient')
    // for r3-id-3.0.1.jar
    implementation('commons-digester:commons-digester:2.1')
    // Azure App Configuration
    implementation('com.microsoft.azure:spring-cloud-azure-appconfiguration-config-web:1.3.0')
    implementation('com.microsoft.azure:spring-cloud-azure-feature-management-web:1.3.0')

    testImplementation("org.springframework.boot:spring-boot-starter-test")
    
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM