SpringBoot 3.0.0-M1 + SpringCloud 2022.0.0-M1 [错误] org.springframework.cloud:spring-cloud-starter-sleuth:jar 缺少“dependency.version”

Pat*_*Pat 6 java spring-boot spring-cloud-sleuth

随着 SpringBoot 3.0.0-M1 和 SpringCloud 2022.0.0-M1 的发布,我继续升级版本。

\n

https://spring.io/blog/2022/01/20/spring-boot-3-0-0-m1-is-now-available

\n

https://spring.io/blog/2022/01/27/spring-cloud-2022-0-0-m1-codename-kilburn-has-been-released

\n

虽然在我的 SpringBoot 2.6.3 + Jubilee 上一切正常,但完全相同的代码,只是将 pom 文件的版本更改为新的 SpringBoot 3.0.0-M1 + SpringCloud 2022.0.0-M1 对,但以下错误是观察到的。

\n
/Library/Java/JavaVirtualMachines/jdk-17.0.2.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=abc -Dmaven.home=maven3 [...] -Didea.version=2021.3.1 clean install\n[INFO] Scanning for projects...\n[ERROR] [ERROR] Some problems were encountered while processing the POMs:\n[ERROR] \'dependencies.dependency.version\' for org.springframework.cloud:spring-cloud-starter-sleuth:jar is missing. @ line xx, column 21\n[ERROR] \'dependencies.dependency.version\' for org.springframework.cloud:spring-cloud-sleuth-zipkin:jar is missing. @ line xx, column 21\n @ \n
Run Code Online (Sandbox Code Playgroud)\n

根据 Spring Cloud 官方文档:

\n
Spring Cloud Sleuth\n\nSpring Cloud Sleuth\xe2\x80\x99s last minor version is 3.1. You can check the 3.1.x branch for the latest commits.\n\nThe core of this project got 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.\n
Run Code Online (Sandbox Code Playgroud)\n

我很难理解。这是否意味着从 3.0/2022.0 开始,不再有 Sleuth 了?我们需要用千分尺代替吗?

\n

请问如何保留 Sleuth 提供的现有功能?

\n

谢谢

\n

Mar*_*zak 4

我很难理解。这是否意味着从 3.0/2022.0 开始,不再有 Sleuth 了?我们需要用千分尺代替吗?

是的

请问如何保留 Sleuth 提供的现有功能?

我们将通过千分尺和千分尺追踪为这些人提供支持。

这是否意味着我们可以从 pom 文件中删除 Sleuth 依赖项,然后添加/替换为千分尺依赖项,事情会是一样的,仍然可以工作?

如果您没有任何自定义 Sleuth 配置,那么您无需执行任何操作即可使可观察性发挥作用。如果您有自定义 Sleuth 配置,则需要将其移植到 Micrometer Tracing,它本质上是 Sleuth 的副本,因此这应该主要是软件包更改。如果您正在进行 Brave 自定义,那么很可能您无需进行任何更改。

更新:

在这里您可以找到 Sleuth 到 Micrometer Tracing 迁移指南的链接https://github.com/micrometer-metrics/tracing/wiki/Spring-Cloud-Sleuth-3.1-Migration-Guide

  • 这不是真的,请提供一个迁移示例,我现在正在迁移,找不到很多,TraceableExecutorService 等。 (2认同)