Why is Spring Cloud Sleuth not included into Spring Cloud BOM

1.2k views Asked by At

In my Gradle-based multi-module project I've imported Spring Cloud BOM as

plugins {
    id 'java'
    id 'io.spring.dependency-management' version '1.0.13.RELEASE'
    id 'org.springframework.boot' version '2.7.17' apply false
}

ext {
    springSecurityOauthVersion = '5.6.2'
    springCloudVersion = '2022.0.4'
    springBootVersion = '2.7.17'
}
allprojects {
    dependencyManagement {
        imports {
            mavenBom org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES
            mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
        }
    }
}

Then in child project's build.gradle I declare dependencies as

dependencies {
  implementation 'org.springframework.cloud:spring-cloud-starter-consul-discovery'
  implementation 'org.springframework.cloud:spring-cloud-starter-openfeign'
  implementation 'org.springframework.cloud:spring-cloud-starter-sleuth'
}

The problem is that Consul and Feign are resolved, but for Sleuth I get this error at Gradle sync time:

:product-service:main: Could not find org.springframework.cloud:spring-cloud-starter-sleuth:.
Required by:
    project :product-service

It looks like Sleuth is not listed in BOM. What is the reason for this and is there a way to import a BOM having all Spring Cloud dependencies?

1

There are 1 answers

1
Andy Wilkinson On BEST ANSWER

Spring Cloud Sleuth was removed from the release train in Spring Cloud 2022.0:

This project has been removed from the release train. The core of this project has moved to Micrometer Tracing project and the instrumentations will be moved to Micrometer and all respective projects (no longer all instrumentations will be done in a single repository).

The 2022.0 release train requires Spring Boot 3 and you appear to be using Spring Boot 2.7. For compatibility with Spring Boot 2.7 you should use the 2021.0 release train (2021.0.3 or later). This release train includes Spring Cloud Sleuth.