<?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>
  <name>Zeebe Kafka Exporter</name>
  <artifactId>zeebe-kafka-exporter</artifactId>
  <packaging>jar</packaging>
  <url>https://github.com/zeebe-io/zeebe-kafka-exporter/exporter</url>

  <parent>
    <artifactId>zeebe-kafka-exporter-root</artifactId>
    <groupId>io.zeebe</groupId>
    <relativePath>../pom.xml</relativePath>
    <version>3.1.1</version>
  </parent>

  <properties>
    <exporter.finalName>${project.artifactId}-${project.version}</exporter.finalName>
  </properties>

  <dependencies>
    <!-- runtime dependencies which must be packaged with the exporter -->
    <dependency>
      <groupId>io.zeebe</groupId>
      <artifactId>zeebe-kafka-exporter-serde</artifactId>
    </dependency>

    <dependency>
      <groupId>org.apache.kafka</groupId>
      <artifactId>kafka-clients</artifactId>
    </dependency>

    <!-- provided dependencies -->
    <dependency>
      <groupId>io.camunda</groupId>
      <artifactId>zeebe-protocol</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>io.camunda</groupId>
      <artifactId>zeebe-exporter-api</artifactId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <artifactId>slf4j-api</artifactId>
      <groupId>org.slf4j</groupId>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.agrona</groupId>
      <artifactId>agrona</artifactId>
      <scope>provided</scope>
    </dependency>

    <!-- test dependencies -->
    <dependency>
      <groupId>io.camunda</groupId>
      <artifactId>zeebe-protocol-jackson</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.camunda</groupId>
      <artifactId>zeebe-test</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <finalName>${exporter.finalName}</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <configuration>
          <ignoredUnusedDeclaredDependencies>
            <!-- false positive, used as logging output in tests -->
            <unusedDeclaredDependency>org.slf4j:slf4j-simple</unusedDeclaredDependency>
          </ignoredUnusedDeclaredDependencies>
        </configuration>
      </plugin>

      <!-- enforce compatiblity for configuration files -->
      <plugin>
        <groupId>org.revapi</groupId>
        <artifactId>revapi-maven-plugin</artifactId>
        <configuration>
          <analysisConfigurationFiles>
            <configurationFile>
              <path>revapi.json</path>
            </configurationFile>
          </analysisConfigurationFiles>
        </configuration>
      </plugin>

      <!-- build a JAR with the minimal set of dependencies included -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
        <executions>
          <execution>
            <id>standalone</id>
            <goals>
              <goal>single</goal>
            </goals>
            <phase>package</phase>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
