我正在专门开发"zipkin-service"
的微服务。我从链接https://www.baeldung.com/tracing-services-with-zipkin中获得了参考。
任何人都可以指导出什么问题吗?
当我添加下面的依赖项时,我会得到
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-server</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-ui</artifactId>
<scope>runtime</scope>
</dependency>
错误:
项目构建错误:缺少io.zipkin.java:zipkin-autoconfigure-ui:jar的'dependencies.dependency.version'。
pom.xml
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.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.SR1</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-server</artifactId>
</dependency>
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-ui</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>
</dependencies>
</dependencyManagement>
ZipkinServiceApplication.java
@EnableZipkinServer
@EnableDiscoveryClient
@SpringBootApplication
public class ZipkinServiceApplication {
public static void main(String[] args) {
SpringApplication.run(ZipkinServiceApplication.class, args);
}
}
答案 0 :(得分:0)
将此内容添加到pom.xml末尾的您的部分下。您可能需要为所有依赖项添加。
<dependency>
<groupId>io.zipkin.java</groupId>
<artifactId>zipkin-autoconfigure-ui</artifactId>
<version>what-ever-version-number</version></dependency>
答案 1 :(得分:0)
Spring从Spring Boot中弃用了Zipkin UI和Zipkin服务器。您将需要设置外部Zipkin服务器或按上述指定添加pom。
您可以参考以下网址:
http://onlyfullstack.blogspot.com/2018/07/setting-up-zipkin-server.html
以下将Zipking与微服务集成的URL:
https://onlyfullstack.blogspot.com/2018/09/microservices-with-spring-sleuth-and-zipkin.html