<?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.0.3</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>

  <artifactId>apicurio-registry-protobuf-schema-utilities</artifactId>
  <packaging>jar</packaging>
  <name>apicurio-registry-protobuf-schema-utilities</name>

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

  <dependencies>
    <dependency>
      <groupId>com.google.protobuf</groupId>
      <artifactId>protobuf-java</artifactId>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.google.api.grpc/proto-google-common-protos -->
    <dependency>
      <groupId>com.google.api.grpc</groupId>
      <artifactId>proto-google-common-protos</artifactId>
    </dependency>

    <dependency>
      <groupId>com.squareup.wire</groupId>
      <artifactId>wire-schema</artifactId>
    </dependency>

    <dependency>
      <groupId>com.squareup.wire</groupId>
      <artifactId>wire-compiler</artifactId>
      <exclusions>
        <exclusion>
          <groupId>org.jetbrains.kotlinx</groupId>
          <artifactId>kotlinx-serialization-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.jetbrains.kotlinx</groupId>
      <artifactId>kotlinx-serialization-core</artifactId>
    </dependency>
    <dependency>
      <groupId>com.ibm.icu</groupId>
      <artifactId>icu4j</artifactId>
    </dependency>

    <dependency>
      <groupId>com.squareup.okio</groupId>
      <artifactId>okio-jvm</artifactId>
    </dependency>

    <dependency>
      <groupId>com.squareup.okio</groupId>
      <artifactId>okio-fakefilesystem</artifactId>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <!-- Used for Proto assertions in tests -->
    <dependency>
      <groupId>com.google.truth.extensions</groupId>
      <artifactId>truth-proto-extension</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <target>${maven.compiler.target}</target>
          <release>${maven.compiler.target}</release>
          <multiReleaseOutput>true</multiReleaseOutput>
          <showDeprecation>false</showDeprecation>
          <showWarnings>false</showWarnings>
        </configuration>
        <executions>
          <execution>
            <id>jdk8-support</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <release>8</release>
              <target>1.8</target>
              <multiReleaseOutput>false</multiReleaseOutput>
              <showDeprecation>false</showDeprecation>
              <showWarnings>false</showWarnings>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <configuration>
          <archive>
            <manifestEntries>
              <Multi-Release>true</Multi-Release>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>1.7.1</version>
        <executions>
          <execution>
            <goals>
              <goal>detect</goal>
            </goals>
            <phase>initialize</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
        <version>${proto-plugin.version}</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>gencode</id>
            <goals>
              <goal>compile</goal>
              <goal>test-compile</goal>
            </goals>
            <phase>generate-sources</phase>
            <configuration>
              <protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-dist</id>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <phase>prepare-package</phase>
            <configuration>
              <outputDirectory>${project.build.outputDirectory}</outputDirectory>
              <resources>
                <resource>
                  <directory>${project.basedir}/target/generated-test-sources/protobuf/</directory>
                  <filtering>false</filtering>
                  <excludes/>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>

  </build>

</project>
