spring-cloud / spring-cloud-consul

Spring Cloud Consul
http://cloud.spring.io/spring-cloud-consul/
Apache License 2.0
805 stars 543 forks source link

Spring Boot 3.1 Compatibility? #825

Open choweiyuan opened 11 months ago

choweiyuan commented 11 months ago

Describe the bug Spring Cloud Version: 2022.0.3

I am using spring-cloud-starter-consul-discovery (via maven bom 2022.0.3) alongside with Spring Boot 3.1.1, but I'm getting the following error:

2023-07-17T14:26:52.454+01:00  WARN 83218 --- [           main] ConfigServletWebServerApplicationContext : 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@1f6f0fe2 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]']]

According to this blog post, Spring Cloud 2022.0.3 should be compatible with Spring Boot 3.1.x https://spring.io/blog/2023/05/25/spring-cloud-2022-0-3-aka-kilburn-is-available

I was looking at the dependency tree, seems that spring-cloud-starter-consul is fetching an older version of spring-cloud-commons, which isn't compatible with Spring Boot 3.1.x

image

https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-starter-consul/4.0.2

https://github.com/spring-cloud/spring-cloud-commons/commit/a2cc42614c60de7b05100741d13fcf93f32c3849

choweiyuan commented 11 months ago

manually setting the version via gradle kts would workaround the problem

dependencyManagement {
  dependencies {
    dependency("org.springframework.cloud:spring-cloud-commons:4.0.4")
  }
}