0

我的 java 测试代码给出了 Kamon 导入错误“找不到符号 Kamon”我在我的 maven 配置中添加了 kamon 的依赖项。请告诉我哪里出错了?我的示例代码:

package com.logicbig.example;
import kamon;
import kamon.prometheus.PrometheusReporter;

import java.io.IOException;

public class SampleClass {
    static void main(String args[]) throws IOException {
        Kamon.addReporter(new PrometheusReporter());
    }

}

pom.xml:

<?xml version="1.0" encoding="UTF-8"?>

http://maven.apache.org/xsd/maven-4.0.0.xsd">4.0.0

<groupId>1</groupId>
<artifactId>1</artifactId>
<version>1.0-SNAPSHOT</version>

<build>
    <plugins>
        <plugin>
            <!-- Build an executable JAR -->
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.1.0</version>
            <configuration>
                <archive>
                    <manifest>
                        <addClasspath>true</addClasspath>
                        <classpathPrefix>lib/</classpathPrefix>
                        <mainClass>SampleClass</mainClass>
                    </manifest>
                </archive>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>io.kamon</groupId>
        <artifactId>kamon-core_2.12</artifactId>
        <version>1.0.0</version>
    </dependency>

    <!-- Optional Dependencies -->
    <dependency>
        <groupId>io.kamon</groupId>
        <artifactId>kamon-prometheus_2.12</artifactId>
        <version>1.0.0</version>
    </dependency>
    <dependency>
        <groupId>io.kamon</groupId>
        <artifactId>kamon-zipkin_2.12</artifactId>
        <version>1.0.0</version>
    </dependency>
</dependencies>

4

0 回答 0