<?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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>pgv-java</artifactId>
    <groupId>build.buf.protoc-gen-validate</groupId>
    <version>VERSION</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>pgv-java-validation</artifactId>
  <name>PGV-Java Validation Harness</name>
  <build>
    <extensions>
      <extension>
        <groupId>kr.motd.maven</groupId>
        <artifactId>os-maven-plugin</artifactId>
        <version>1.7.1</version>
      </extension>
    </extensions>
    <plugins>
      <plugin>
        <groupId>org.xolstice.maven.plugins</groupId>
        <artifactId>protobuf-maven-plugin</artifactId>
        <version>${protobuf.maven.plugin.version}</version>
        <executions>
          <execution>
            <id>protoc-java</id>
            <goals>
              <goal>compile</goal>
            </goals>
            <configuration>
              <protoSourceRoot>../../</protoSourceRoot>
              <includes>
                <include>tests/harness/harness.proto</include>
                <include>tests/harness/cases/*.proto</include>
                <include>tests/harness/cases/other_package/*.proto</include>
                <include>tests/harness/cases/yet_another_package/*.proto</include>
                <include>tests/harness/cases/sort/*.proto</include>
              </includes>
            </configuration>
          </execution>
          <execution>
            <id>protoc-java-pgv</id>
            <goals>
              <goal>compile-custom</goal>
            </goals>
            <configuration>
              <protoSourceRoot>../../</protoSourceRoot>
              <pluginParameter>lang=java</pluginParameter>
              <includes>
                <include>tests/harness/cases/*.proto</include>
                <include>tests/harness/cases/other_package/*.proto</include>
                <include>tests/harness/cases/yet_another_package/*.proto</include>
              </includes>
              <pluginId>java-pgv</pluginId>
              <pluginArtifact>build.buf.protoc-gen-validate:protoc-gen-validate:${project.version}:exe:${os.detected.classifier}</pluginArtifact>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <protocArtifact>com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier}</protocArtifact>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.5.1</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <finalName>java-harness</finalName>
              <transformers>
                <transformer>
                  <manifestEntries>
                    <Main-Class>io.envoyproxy.pgv.validation.JavaHarness</Main-Class>
                  </manifestEntries>
                </transformer>
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.10</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>build.buf.protoc-gen-validate</groupId>
      <artifactId>protoc-gen-validate</artifactId>
      <version>VERSION</version>
      <type>pom</type>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>hamcrest-core</artifactId>
          <groupId>org.hamcrest</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.24.2</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>byte-buddy</artifactId>
          <groupId>net.bytebuddy</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <properties>
    <skipNexusStagingDeployMojo>true</skipNexusStagingDeployMojo>
  </properties>
</project>
