<?xml version="1.0" encoding="UTF-8"?>
<!--
    Copyright (c) 2019, 2025 Oracle and/or its affiliates.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  -->

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>io.helidon.tracing.providers</groupId>
        <artifactId>helidon-tracing-providers-project</artifactId>
        <version>4.3.0</version>
    </parent>

    <artifactId>helidon-tracing-providers-jaeger</artifactId>
    <name>Helidon Tracing Providers Jaeger</name>

    <description>
        Integration with Jaeger tracing
    </description>

    <dependencies>
        <dependency>
            <groupId>io.helidon.common</groupId>
            <artifactId>helidon-common-configurable</artifactId>
        </dependency>
        <dependency>
            <groupId>io.opentelemetry</groupId>
            <artifactId>opentelemetry-sdk</artifactId>
        </dependency>
        <dependency>
            <groupId>io.opentelemetry</groupId>
            <artifactId>opentelemetry-exporter-jaeger</artifactId>
        </dependency>
        <dependency>
            <groupId>io.helidon.tracing.providers</groupId>
            <artifactId>helidon-tracing-providers-opentelemetry</artifactId>
        </dependency>
        <dependency>
            <groupId>io.helidon.common</groupId>
            <artifactId>helidon-common</artifactId>
        </dependency>
        <dependency>
            <groupId>io.helidon.common</groupId>
            <artifactId>helidon-common-context</artifactId>
        </dependency>
        <dependency>
            <groupId>io.helidon.config</groupId>
            <artifactId>helidon-config</artifactId>
        </dependency>
        <dependency>
            <groupId>io.helidon.tracing</groupId>
            <artifactId>helidon-tracing</artifactId>
        </dependency>
        <dependency>
            <!-- redirecting Jaeger slf4j logging to JUL logging -->
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
        </dependency>
        <!-- Needed for module-info -->
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>io.helidon.common.features</groupId>
            <artifactId>helidon-common-features-api</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>io.helidon.config</groupId>
            <artifactId>helidon-config-metadata</artifactId>
            <optional>true</optional>
        </dependency>

        <!--
         - Test dependencies
         -->

        <!-- OTel dependencies needed to get fully-functional propagators -->
        <dependency>
            <groupId>io.opentelemetry</groupId>
            <artifactId>opentelemetry-sdk-extension-autoconfigure</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.opentelemetry</groupId>
            <artifactId>opentelemetry-exporter-otlp</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- -->

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.helidon.config</groupId>
            <artifactId>helidon-config-yaml</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.helidon.common.testing</groupId>
            <artifactId>helidon-common-testing-junit5</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <!-- Separate some of the tests to avoid interference with other tests -->
                <executions>
                    <execution>
                        <id>default-test</id>
                        <configuration>
                            <excludes>**/JaegerBaggagePropagationTest.java,**/JaegerTracerBuilderTest.java</excludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>baggage-propagation-test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <properties>
                                <configurationParameters>
                                    junit.jupiter.extensions.autodetection.enabled = true
                                </configurationParameters>
                            </properties>
                            <includes>**/JaegerBaggagePropagationTest.java</includes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>tracer-builder-tests</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <properties>
                                <configurationParameters>
                                    junit.jupiter.extensions.autodetection.enabled = true
                                </configurationParameters>
                            </properties>
                            <includes>**/JaegerTracerBuilderTest.java</includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>io.helidon.codegen</groupId>
                            <artifactId>helidon-codegen-apt</artifactId>
                            <version>${helidon.version}</version>
                        </path>
                        <path>
                            <groupId>io.helidon.common.features</groupId>
                            <artifactId>helidon-common-features-codegen</artifactId>
                            <version>${helidon.version}</version>
                        </path>
                        <path>
                            <groupId>io.helidon.config.metadata</groupId>
                            <artifactId>helidon-config-metadata-codegen</artifactId>
                            <version>${helidon.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>io.helidon.codegen</groupId>
                        <artifactId>helidon-codegen-apt</artifactId>
                        <version>${helidon.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>io.helidon.common.features</groupId>
                        <artifactId>helidon-common-features-codegen</artifactId>
                        <version>${helidon.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>io.helidon.config.metadata</groupId>
                        <artifactId>helidon-config-metadata-codegen</artifactId>
                        <version>${helidon.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
</project>
