<?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">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.github.ngeor</groupId>
    <artifactId>java</artifactId>
    <version>1.7.0</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <artifactId>yak4j-filename-conventions-maven-plugin</artifactId>
  <version>0.18.0</version>
  <packaging>maven-plugin</packaging>
  <name>yak4j-filename-conventions-maven-plugin</name>
  <description>yak shaving for Java: A Maven plugin which enforces filename conventions</description>
  <properties>
    <!--
    plugins
    -->
    <maven-invoker-plugin.version>3.2.1</maven-invoker-plugin.version>
    <!--
    dependencies for maven plugins
    -->
    <maven-core.version>3.6.3</maven-core.version>
    <maven-plugin-plugin.version>3.6.0</maven-plugin-plugin.version>
    <!--
    jacoco thresholds
    -->
    <jacoco.it-tests.limit.instruction-ratio>95%</jacoco.it-tests.limit.instruction-ratio>
    <jacoco.it-tests.limit.branch-ratio>89%</jacoco.it-tests.limit.branch-ratio>
    <jacoco.it-tests.limit.class-complexity>16</jacoco.it-tests.limit.class-complexity>
    <jacoco.it-tests.limit.method-complexity>5</jacoco.it-tests.limit.method-complexity>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-plugin-api</artifactId>
      <version>${maven-core.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-core</artifactId>
      <version>${maven-core.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven</groupId>
      <artifactId>maven-artifact</artifactId>
      <version>${maven-core.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.maven.plugin-tools</groupId>
      <artifactId>maven-plugin-annotations</artifactId>
      <version>${maven-plugin-plugin.version}</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.eluder.coveralls</groupId>
        <artifactId>coveralls-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-plugin-plugin</artifactId>
        <version>${maven-plugin-plugin.version}</version>
        <configuration>
          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
        </configuration>
        <executions>
          <execution>
            <id>mojo-descriptor</id>
            <goals>
              <goal>descriptor</goal>
            </goals>
          </execution>
          <execution>
            <id>help-goal</id>
            <goals>
              <goal>helpmojo</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <configuration>
          <excludes>**/HelpMojo.*</excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-invoker-plugin</artifactId>
        <version>${maven-invoker-plugin.version}</version>
        <configuration>
          <debug>true</debug>
          <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
          <postBuildHookScript>verify</postBuildHookScript>
          <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
          <settingsFile>src/it/settings.xml</settingsFile>
          <goals>
            <goal>clean</goal>
            <goal>validate</goal>
          </goals>
        </configuration>
        <executions>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>install</goal>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <configuration>
          <excludes>
            <!-- generated file -->
            <exclude>com/github/ngeor/yak4j/HelpMojo.class</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <id>pre-integration-test</id>
            <goals>
              <goal>prepare-agent-integration</goal>
            </goals>
            <phase>pre-integration-test</phase>
            <configuration>
              <propertyName>invoker.mavenOpts</propertyName>
            </configuration>
          </execution>
          <execution>
            <id>post-integration-test</id>
            <goals>
              <goal>report-integration</goal>
            </goals>
            <phase>post-integration-test</phase>
          </execution>
          <execution>
            <id>check-integration-test</id>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>post-integration-test</phase>
            <configuration>
              <dataFile>${project.build.directory}/jacoco-it.exec</dataFile>
              <rules>
                <rule>
                  <element>BUNDLE</element>
                  <limits>
                    <limit>
                      <counter>INSTRUCTION</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>${jacoco.it-tests.limit.instruction-ratio}</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>${jacoco.it-tests.limit.branch-ratio}</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <limits>
                    <limit>
                      <counter>COMPLEXITY</counter>
                      <value>TOTALCOUNT</value>
                      <maximum>${jacoco.it-tests.limit.class-complexity}</maximum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>METHOD</element>
                  <limits>
                    <limit>
                      <counter>COMPLEXITY</counter>
                      <value>TOTALCOUNT</value>
                      <maximum>${jacoco.it-tests.limit.method-complexity}</maximum>
                    </limit>
                  </limits>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
