<?xml version="1.0"?>
<!--

    Copyright The OpenZipkin Authors
    SPDX-License-Identifier: Apache-2.0

-->
<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>
  <parent>
    <groupId>io.zipkin.brave</groupId>
    <artifactId>brave-instrumentation-parent</artifactId>
    <version>6.0.3</version>
  </parent>

  <artifactId>brave-instrumentation-kafka-clients</artifactId>
  <name>Brave Instrumentation: Kafka Clients</name>

  <properties>
    <!-- Matches Export-Package in bnd.bnd -->
    <module.name>brave.kafka.clients</module.name>

    <main.basedir>${project.basedir}/../..</main.basedir>

    <kafka-clients-floor.version>1.0.0</kafka-clients-floor.version>

    <!-- disable errorprone override warning as we do this intentionally to allow old clients -->
    <errorprone.args>-Xep:MissingOverride:OFF</errorprone.args>
  </properties>

  <dependencies>
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>brave-instrumentation-messaging</artifactId>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.kafka</groupId>
      <artifactId>kafka-clients</artifactId>
      <version>${kafka.version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>*</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>brave-tests</artifactId>
      <scope>test</scope>
      <version>${project.version}</version>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${testcontainers.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-invoker-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>de.qaware.maven</groupId>
        <artifactId>go-offline-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>resolve-dependencies</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <!-- Add dependencies specific to invoker tests so that they cache on go-offline -->
          <dynamicDependencies>
            <DynamicDependency>
              <groupId>org.apache.kafka</groupId>
              <artifactId>kafka-clients</artifactId>
              <version>${kafka-clients-floor.version}</version>
              <repositoryType>MAIN</repositoryType>
              <type>jar</type>
            </DynamicDependency>
          </dynamicDependencies>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
