spring-cloud / spring-cloud-release

Spring Cloud Release Train - dependency management across a wide range of Spring Cloud projects.
http://projects.spring.io/spring-cloud
Apache License 2.0
874 stars 179 forks source link

Spring Boot [3.1.1] is not compatible with this Spring Cloud release train #266

Closed jesperancinha closed 1 year ago

jesperancinha commented 1 year ago

Describe the bug I'm trying to update to 3.1.1 and the latest Spring Cloud doesn't seem to work with it: 2022.0.3

Sample Please check the running PR here: https://github.com/jesperancinha/staco-app/pull/1963

2023-07-02T06:43:44.424Z  WARN 7 --- [           main] onfigReactiveWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compositeCompatibilityVerifier' defined in class path resource [org/springframework/cloud/configuration/CompatibilityVerifierAutoConfiguration.class]: Failed to instantiate [org.springframework.cloud.configuration.CompositeCompatibilityVerifier]: Factory method 'compositeCompatibilityVerifier' threw exception with message: Spring Cloud/ Spring Boot version compatibility checks have failed: [[VerificationResult@7f37b6d9 description = 'Spring Boot [3.1.1] is not compatible with this Spring Cloud release train', action = 'Change Spring Boot version to one of the following versions [3.0.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]']]
2023-07-02T06:43:44.462Z  INFO 7 --- [           main] .s.b.a.l.ConditionEvaluationReportLogger : 

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-07-02T06:43:44.483Z ERROR 7 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

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

Description:

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

- Spring Boot [3.1.1] 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 [3.0.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]
marcingrzejszczak commented 1 year ago

Are you sure you have not overridden spring-cloud-commons version? For 2022.0.3, commons version is 4.0.3 and we do support Boot 3.1 there. Look at https://github.com/spring-cloud/spring-cloud-commons/blob/v4.0.3/spring-cloud-commons/src/main/java/org/springframework/cloud/configuration/CompatibilityVerifierProperties.java#L39 and https://github.com/spring-cloud/spring-cloud-commons/blob/v4.0.3/spring-cloud-commons/src/main/java/org/springframework/cloud/configuration/SpringBootVersionVerifier.java#L37

jesperancinha commented 1 year ago

@marcingrzejszczak , thanks for you answer. It only downloads commons 4.0.1 to my local maven repo. I can't find any library that could possibly be overriding it. I'm not doing it anywhere intentionally any way.

jesperancinha commented 1 year ago

@marcingrzejszczak , I have fixed the issue forcing the usage of version 4.0.3. Thanks for the tip! 👍. I am closing the issue because I just wanted some sort of fix. However, feel free to examine my repository if you'd like to find the actual source of this problem. I checked and I can't find any dependency that is forcing this to be 4.0.1. There is a chance that somewhere in the parent pom or its subdependencies a 4.0.1 declaration is somehow forcing spring-cloud-commons to be 4.0.1. in spring-cloud-dependencies-parent downwards.

pmverma commented 1 year ago

I am having the same issue with SB 3.1.1.

@marcingrzejszczak I can confirm that with spring cloud version 2022.0.3, spring-cloud-starter version 4.0.1 is being resolved somehow. Overriding with the maven property <spring-cloud-starter.version>4.0.3</spring-cloud-starter.version> resolves this issue.

spencergibb commented 1 year ago

@pmverma I am unable to reproduce the problem. With a fresh project from start.spring.io with spring-cloud-starter as a dependency I get

[INFO] +- org.springframework.cloud:spring-cloud-starter:jar:4.0.3:compile

If you'd like us to spend some time investigating, please take the time to provide a complete, minimal, verifiable sample (something that we can unzip attached to this issue or git clone, build, and deploy) that reproduces the problem and we can reopen the issue.

pmverma commented 1 year ago

Indeed, it was an issue with the Maven BOM import order, and the version from io.awspring.cloud was picked up. I have fixed it by changing the import order (importing the org.springframework.cloud first).

    </dependencyManagement>
             <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.awspring.cloud</groupId>
                <artifactId>spring-cloud-aws-dependencies</artifactId>
                <version>${io.awspring.cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
spencergibb commented 1 year ago

File an issue there, they are good about that kind of thing https://github.com/awspring/spring-cloud-aws/issues