gpt4 book ai didi

java - Spring Sleuth 和 Zipkin :Could not find artifact io. zipkin.brave :brave-bom:pom:4. 16.3-SNAPSHOT

转载 作者:塔克拉玛干 更新时间:2023-11-01 22:38:40 27 4
gpt4 key购买 nike

我有一个 Spring Boot 2.0.0 REST 服务,我正在尝试启用 Sleuth 和 Zipkin 以将跟踪发送到我的本地主机 Zipkin 服务器。

应用程序运行良好,直到我将两个依赖项 spring-cloud-starter-sleuthspring-cloud-sleuth-zipkin 添加到我的 pom.xml 中。这样做后,我现在遇到编译错误:

Project build error: Non-resolvable import POM: Could not find artifact io.zipkin.brave:brave-bom:pom:4.16.3-SNAPSHOT

我通过删除我的 .m2 文件夹并更新(两次)确保这不是损坏的 Maven 包问题。

为什么会出现此错误,我该如何解决?

这是我的 pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>io.urig</groupId>
<artifactId>inventory</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>inventory</name>
<description>Demo project for Spring Boot</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-cloud.version>Finchley.M8</spring-cloud.version>
<sleuth.version>2.0.0.M8</sleuth.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.retry</groupId>
<artifactId>spring-retry</artifactId>
</dependency>
<!-- Sleuth automatically adds trace interceptors when in the classpath -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
</dependency>
<!-- Sends trace data to zipkin over http (defaults to http://localhost:9411/api/v2/spans) -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth-zipkin</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<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>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-sleuth</artifactId>
<version>${sleuth.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project>

最佳答案

这真的很奇怪,因为您使用的是最新版本并且在 GitHub spring-cloud-sleuth 中依赖于 <brave.version>4.17.2</brave.version> .而且我认为 Maven 仓库中不存在 4.16.3-SNAPSHOT 版本。 (刚查了2.0.0.M8依赖这个版本)

如果改为<sleuth.version>2.0.0.M7</sleuth.version>它确实找到了所需的依赖项。

https://github.com/spring-cloud/spring-cloud-sleuth/blob/master/pom.xml

关于java - Spring Sleuth 和 Zipkin :Could not find artifact io. zipkin.brave :brave-bom:pom:4. 16.3-SNAPSHOT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49211771/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com