0

I am trying to use the spring-cloud-task-core version 2.4.1 with the spring-boot version 2.6.6 (from the 2021.0.x release train). This is showing me the below error:

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

- Spring Boot [2.6.6] 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.4.x, 2.5.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]

Does it mean that the cloud-task 2.4.1 is incompatible with spring-boot 2.6.6? Wanted to confirm here first before I raise the issue with the spring community.

Edit-1: My Pom.xml for using spring-cloud-task-dependencies as BOM:

For previous spring-boot 2.1.1:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

For proposed spring-boot 2.6.6 or 2.5.12:

   <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-task-dependencies</artifactId>
                <version>${spring-cloud-task-dependencies.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

Here, I have to use the spring-cloud-task-dependencies.version because the spring-boot.version gives below error:

Jatin Kheradiya
  • 50
  • 1
  • 10

1 Answers1

1

Spring Boot 2.6.6 and Spring Cloud Task 2.4.1 are compatible.

The message is generated by the SpringBootVersionVerifier that is part of spring-cloud-commons. You seem to have that artifact with version 3.0.x on your classpath although you need version 3.1.x.

You need to ensure that the version of spring-cloud-commons is not somehow fixed to some old version. It's easiest to have the version managed by the bom of the Spring Cloud release train 2021.0.x.

The maven snippet from the Spring Initializr for this is

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-dependencies</artifactId>
      <version>${spring-cloud.version}</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

where spring-cloud.version should be set to 2021.0.1.

Henning
  • 3,055
  • 6
  • 30
  • I am using spring-cloud-task-dependencies via BOM itself and nowhere `spring-cloud-commons`. – Jatin Kheradiya Apr 24 '22 at 11:03
  • Can you post your `pom.xml` or gradle setup for the versions? – Henning Apr 24 '22 at 11:38
  • have updated the question with POM supported previously as well as new change I am trying. – Jatin Kheradiya Apr 25 '22 at 08:42
  • I'm afraid the snippet from the `pom.xml` is not enough. If you start a fresh project with the Spring Initializr with only Spring Cloud Task for Spring Boot 2.6.x, you get a working setup with SCT 2.4.1. And this setup does not contain `spring-cloud-commons`. You seem to have some other Spring Cloud dependency besides Task that pulls it in. – Henning Apr 25 '22 at 12:31
  • I added the the dependency management snippet from the Spring Initializr to my answer. With this all Spring Cloud dependencies should get versions that are compatible with Spring Boot 2.6.x. – Henning Apr 25 '22 at 19:46
  • I am using `spring-cloud-starter-task` version as below: ``` org.springframework.cloud spring-cloud-starter-task ``` which uses version 2.4.1. Also tried using the BOM you shared but it still shows the same error on running the application: `- Spring Boot [2.6.6] is not compatible with this Spring Cloud release train` – Jatin Kheradiya Apr 28 '22 at 08:59
  • I realized, the issue was the way I was running the spring-batch jobs in custom fashion by overriding the parameters. – Jatin Kheradiya Apr 06 '23 at 06:40