<?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>
  <parent>
    <groupId>io.apicurio</groupId>
    <artifactId>apicurio-registry</artifactId>
    <version>3.2.0</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>

  <artifactId>apicurio-registry-utils-exportConfluent</artifactId>
  <packaging>jar</packaging>
  <name>apicurio-registry-utils-exportConfluent</name>

  <properties>
    <projectRoot>${project.basedir}/../..</projectRoot>
  </properties>

  <dependencies>

    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-arc</artifactId>
    </dependency>

    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
    </dependency>

    <dependency>
      <groupId>io.apicurio</groupId>
      <artifactId>apicurio-registry-common</artifactId>
    </dependency>

    <dependency>
      <groupId>io.apicurio</groupId>
      <artifactId>apicurio-registry-utils-import-export</artifactId>
    </dependency>

    <!-- https://mvnrepository.com/artifact/io.confluent/kafka-schema-registry-client -->
    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>kafka-schema-registry-client</artifactId>
      <version>${confluent.version}</version>
    </dependency>

    <!-- Test dependencies -->
    <dependency>
      <groupId>io.quarkus</groupId>
      <artifactId>quarkus-junit5</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>kafka</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.apicurio</groupId>
      <artifactId>apicurio-registry-java-sdk</artifactId>
      <scope>test</scope>
    </dependency>

    <!-- Confluent schema providers for tests -->
    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>kafka-avro-serializer</artifactId>
      <version>${confluent.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>kafka-json-schema-serializer</artifactId>
      <version>${confluent.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>io.confluent</groupId>
      <artifactId>kafka-protobuf-serializer</artifactId>
      <version>${confluent.version}</version>
      <scope>test</scope>
    </dependency>

    <!-- JUnit 5 for tests -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>${version.puppycrawl}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>validate</id>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>validate</phase>
            <configuration>
              <configLocation>../../.checkstyle/simple.xml</configLocation>
              <headerLocation>../../.checkstyle/java.header</headerLocation>
              <suppressionsLocation>../../.checkstyle/suppressions.xml</suppressionsLocation>
              <includeTestSourceDirectory>true</includeTestSourceDirectory>
              <consoleOutput>true</consoleOutput>
              <failsOnError>true</failsOnError>
              <inputEncoding>UTF-8</inputEncoding>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>io.smallrye</groupId>
        <artifactId>jandex-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>make-index</id>
            <goals>
              <goal>jandex</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>io.quarkus</groupId>
        <artifactId>quarkus-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>build</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>default</id>
            <goals>
              <goal>single</goal>
            </goals>
            <phase>package</phase>
            <configuration>
              <appendAssemblyId>false</appendAssemblyId>
              <attach>true</attach>
              <!-- we want attach & deploy these to Maven -->
              <descriptors>
                <descriptor>src/main/assembly/exportConfluent.xml</descriptor>
              </descriptors>
              <tarLongFileMode>${tar.long.file.mode}</tarLongFileMode>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
