<?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>com.github.gantsign.parent</groupId>
    <artifactId>common-parent</artifactId>
    <version>2.3.0</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>java8-parent</artifactId>
  <packaging>pom</packaging>

  <name>Java 8 Parent</name>
  <description>Parent for Java 8 projects</description>

  <properties>
    <javac.version>9+181-r4173-1</javac.version>
  </properties>

  <build>
    <plugins>
      <plugin>
        <groupId>com.coveo</groupId>
        <artifactId>fmt-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <inherited>false</inherited>
        <configuration>
          <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
          <streamLogs>true</streamLogs>
        </configuration>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>install</goal>
              <goal>run</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>error-prone</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>${maven-compiler-plugin.version}</version>
              <configuration>
                <fork>true</fork>
                <compilerArgs>
                  <arg>-XDcompilePolicy=simple</arg>
                  <!-- Suppress UnusedVariable check until https://github.com/google/error-prone/issues/1266 is fixed -->
                  <arg>-Xplugin:ErrorProne -Xep:UnusedVariable:OFF</arg>
                  <arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${javac.version}/javac-${javac.version}.jar</arg>
                </compilerArgs>
                <showDeprecation>true</showDeprecation>
                <showWarnings>true</showWarnings>
                <annotationProcessorPaths>
                  <path>
                    <groupId>com.google.errorprone</groupId>
                    <artifactId>error_prone_core</artifactId>
                    <version>${error-prone.version}</version>
                  </path>
                  <path>
                    <groupId>org.mockito</groupId>
                    <artifactId>mockito-errorprone</artifactId>
                    <version>${mockito.version}</version>
                  </path>
                </annotationProcessorPaths>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
      </build>
    </profile>
  </profiles>

</project>
