<?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>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>9</version>
  </parent>

  <groupId>com.github.sevntu-checkstyle</groupId>
  <artifactId>sevntu-checks</artifactId>
  <version>1.40.0</version>

  <properties>
    <project.build.sourceEncoding>iso-8859-1</project.build.sourceEncoding>
    <!-- It is compile dependency to checkstyle, this version has to be the same as eclipse-cs depends on -->
    <checkstyle.eclipse-cs.version>8.40</checkstyle.eclipse-cs.version>
    <!-- verify time version -->
    <checkstyle.version>8.42</checkstyle.version>
    <checkstyle.configLocation>https://raw.githubusercontent.com/checkstyle/checkstyle/checkstyle-${checkstyle.version}/config/checkstyle_checks.xml</checkstyle.configLocation>
    <checkstyle.plugin.version>3.1.2</checkstyle.plugin.version>
    <sevntu.maven.plugin>RELEASE</sevntu.maven.plugin>
    <maven.jacoco.plugin.version>0.8.6</maven.jacoco.plugin.version>
    <maven.pmd.plugin.version>3.11.0</maven.pmd.plugin.version>
    <pmd.version>6.35.0</pmd.version>
    <java.version>1.8</java.version>
    <junit.version>5.7.1</junit.version>
    <assertj.version>3.19.0</assertj.version>
    <truth.version>1.1.2</truth.version>
  </properties>

  <licenses>
    <license>
      <name>LGPL-2.1+</name>
      <url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt</url>
    </license>
  </licenses>

  <dependencies>
    <dependency>
      <groupId>com.puppycrawl.tools</groupId>
      <artifactId>checkstyle</artifactId>
      <version>${checkstyle.eclipse-cs.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.puppycrawl.tools</groupId>
      <artifactId>checkstyle</artifactId>
      <type>test-jar</type>
      <scope>test</scope>
      <version>${checkstyle.eclipse-cs.version}</version>
    </dependency>
    <!-- required for Jsr305AnnotationsCheck -->
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>3.0.2</version>
    </dependency>
    <!-- required for Jsr305AnnotationsCheck -->
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>annotations</artifactId>
      <version>3.0.1</version>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.eclipse.jgit</groupId>
      <artifactId>org.eclipse.jgit</artifactId>
      <version>5.10.0.202012080955-r</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.jacoco</groupId>
      <artifactId>org.jacoco.agent</artifactId>
      <version>${maven.jacoco.plugin.version}</version>
      <classifier>runtime</classifier>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${assertj.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.google.truth</groupId>
      <artifactId>truth</artifactId>
      <version>${truth.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-pmd-plugin</artifactId>
          <version>${maven.pmd.plugin.version}</version>
          <configuration>
            <analysisCache>false</analysisCache>
            <targetJdk>${java.version}</targetJdk>
            <minimumTokens>20</minimumTokens>
            <skipEmptyReport>false</skipEmptyReport>
            <failOnViolation>true</failOnViolation>
            <printFailingErrors>true</printFailingErrors>
            <includeTests>true</includeTests>
            <rulesets>
              <ruleset>pmd-main.xml</ruleset>
              <ruleset>pmd-test.xml</ruleset>
            </rulesets>
            <excludeRoots>
              <excludeRoot>src/it/resources</excludeRoot>
              <excludeRoot>src/test/resources</excludeRoot>
              <excludeRoot>target/generated-sources/antlr</excludeRoot>
              <excludeRoot>
                target/generated-sources/antlr/com/puppycrawl/tools/checkstyle/grammar/javadoc
              </excludeRoot>
            </excludeRoots>
          </configuration>
          <dependencies>
            <dependency>
              <groupId>net.sourceforge.pmd</groupId>
              <artifactId>pmd-java</artifactId>
              <version>${pmd.version}</version>
            </dependency>
            <dependency>
              <groupId>net.sourceforge.pmd</groupId>
              <artifactId>pmd-core</artifactId>
              <version>${pmd.version}</version>
            </dependency>
            <dependency>
              <groupId>net.sourceforge.pmd</groupId>
              <artifactId>pmd-javascript</artifactId>
              <version>${pmd.version}</version>
            </dependency>
            <dependency>
              <groupId>net.sourceforge.pmd</groupId>
              <artifactId>pmd-jsp</artifactId>
              <version>${pmd.version}</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.4</version>
          <configuration>
            <!-- To allow build with latest JDK the source version must be explicitly set
              See https://bugs.openjdk.java.net/browse/JDK-8212233 for details -->
            <source>${java.version}</source>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <phase>package</phase>
              <goals>
                <goal>jar</goal>
              </goals>
           </execution>
         </executions>
      </plugin>

      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.8</version>
        <extensions>true</extensions>
        <configuration>
          <!-- serverId is ID of a <server> section from Maven's settings.xml
              to pick authentication information from
          -->
          <serverId>sonatype-nexus-staging</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
          <skipStaging>true</skipStaging>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.17</version>
        <configuration>
          <additionalClasspathElements>
            <additionalClasspathElement>src/test/resources-noncompilable</additionalClasspathElement>
          </additionalClasspathElements>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>1.9.1</version>
        <executions>
          <execution>
            <id>add-test-source</id>
            <phase>generate-test-sources</phase>
            <goals>
              <goal>add-test-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/test/resources</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${checkstyle.plugin.version}</version>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>${checkstyle.version}</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <!-- https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference
                 to run checkstyle validation in terminal please use command "mvn process-classes"
            -->
            <phase>process-classes</phase>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <configLocation>${checkstyle.configLocation}</configLocation>
              <failOnViolation>true</failOnViolation>
              <linkXRef>false</linkXRef>
              <propertiesLocation>checkstyle.properties</propertiesLocation>
              <sourceDirectories>
                <sourceDirectory>${project.basedir}/src</sourceDirectory>
              </sourceDirectories>
              <excludes>**/test/resources/**/*,**/test/resources-noncompilable/**/*</excludes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${maven.jacoco.plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>default-report</id>
            <phase>site</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
          <execution>
            <id>default-check</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <rules>
                <rule>
                  <element>CLASS</element>
                  <excludes>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.AvoidModifiersForTypesCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.CustomDeclarationOrderCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.CustomDeclarationOrderCheck.ClassDetail</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.CustomDeclarationOrderCheck.FormatMatcher</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.EitherLogOrThrowCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.EmptyPublicCtorInClassCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.ForbidCertainImportsCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.ForbidCertainMethodCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.ForbidInstantiationCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.ForbidThrowAnonymousExceptionsCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.Jsr305AnnotationsCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.MapIterationInForEachLoopCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.NoNullForCollectionReturnCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.NumericLiteralNeedsUnderscoreCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.OverridableMethodInConstructorCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.RedundantReturnCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.RequireFailForTryCatchInJunitCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.coding.ReturnNullInsteadOfBooleanCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.design.AvoidConditionInversionCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.design.CauseParameterInExceptionCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.design.CheckstyleTestMakeupCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.design.HideUtilityClassConstructorCheck</exclude>
                    <exclude>com.github.sevntu.checkstyle.checks.design.PublicReferenceToPrivateTypeCheck</exclude>
                  </excludes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>1.00</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>1.00</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.AvoidModifiersForTypesCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.99</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.98</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.CustomDeclarationOrderCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.92</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.81</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.CustomDeclarationOrderCheck.ClassDetail</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.96</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.82</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.CustomDeclarationOrderCheck.FormatMatcher</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.82</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.88</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.EitherLogOrThrowCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.99</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.88</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.EmptyPublicCtorInClassCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.99</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.96</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.ForbidCertainImportsCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.97</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.96</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.ForbidCertainMethodCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.97</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.94</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.ForbidInstantiationCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.98</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.97</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.ForbidThrowAnonymousExceptionsCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.97</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.81</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.Jsr305AnnotationsCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.98</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.97</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.MapIterationInForEachLoopCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.99</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.90</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.NoNullForCollectionReturnCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.96</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.86</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.NumericLiteralNeedsUnderscoreCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.94</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.94</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.OverridableMethodInConstructorCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.99</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.95</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.RedundantReturnCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.99</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.98</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.RequireFailForTryCatchInJunitCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.98</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.97</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.coding.ReturnNullInsteadOfBooleanCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.92</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.80</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.design.AvoidConditionInversionCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.98</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.97</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.design.CauseParameterInExceptionCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.98</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.96</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.design.CheckstyleTestMakeupCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.99</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.99</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.design.HideUtilityClassConstructorCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>1.00</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.96</minimum>
                    </limit>
                  </limits>
                </rule>
                <rule>
                  <element>CLASS</element>
                  <includes>
                    <include>com.github.sevntu.checkstyle.checks.design.PublicReferenceToPrivateTypeCheck</include>
                  </includes>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.98</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>0.98</minimum>
                    </limit>
                  </limits>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>coverall</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.7.1.201405082137</version>
            <executions>
              <execution>
                <id>pre-unit-test</id>
                <goals>
                  <goal>prepare-agent</goal>
                </goals>
              </execution>
              <execution>
                <id>post-unit-test</id>
                <goals>
                  <goal>report</goal>
                </goals>
                <phase>test</phase>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.eluder.coveralls</groupId>
            <artifactId>coveralls-maven-plugin</artifactId>
            <version>4.3.0</version>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>eclipse-compiler</id>
      <dependencies>
        <dependency>
            <groupId>org.eclipse.jdt</groupId>
            <artifactId>org.eclipse.jdt.annotation</artifactId>
            <version>2.1.0</version>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.6.0</version>
            <configuration>
              <executable>.ci/eclipse-compiler-javac.sh</executable>
              <classpathScope>test</classpathScope>
              <arguments>
                <classpath/>
                <argument>${checkstyle.eclipse-cs.version}</argument>
              </arguments>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>no-validations</id>
      <properties>
        <skipTests>true</skipTests>
        <linkcheck.skip>true</linkcheck.skip>
        <maven.javadoc.skip>true</maven.javadoc.skip>
        <checkstyle.skip>true</checkstyle.skip>
        <pmd.skip>true</pmd.skip>
        <xml.skip>true</xml.skip>
        <forbiddenapis.skip>true</forbiddenapis.skip>
        <findbugs.skip>true</findbugs.skip>
        <jacoco.skip>true</jacoco.skip>
        <maven.site.skip>true</maven.site.skip>
      </properties>
    </profile>
    <profile>
      <id>selftesting</id>
      <properties>
        <checkstyle.skip>false</checkstyle.skip>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <version>${checkstyle.plugin.version}</version>
            <dependencies>
              <dependency>
                <groupId>com.puppycrawl.tools</groupId>
                <artifactId>checkstyle</artifactId>
                <version>${checkstyle.eclipse-cs.version}</version>
              </dependency>
              <!-- attention here is self-referencing, so be sure you did "mvn install" before "mvn verify -Pselftesting" -->
              <dependency>
                <groupId>com.github.sevntu-checkstyle</groupId>
                <artifactId>sevntu-checks</artifactId>
                <version>${project.version}</version>
              </dependency>
            </dependencies>
            <executions>
              <execution>
                <!-- https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference
                     to run checkstyle validation in terminal please use command "mvn process-classes"
                -->
                <phase>process-classes</phase>
                <goals>
                  <goal>check</goal>
                </goals>
                <configuration>
                  <configLocation>sevntu-checks.xml</configLocation>
                  <failOnViolation>true</failOnViolation>
                  <linkXRef>false</linkXRef>
                  <sourceDirectories>
                    <sourceDirectory>${project.basedir}/src</sourceDirectory>
                  </sourceDirectories>
                  <excludes>**/test/resources/**/*,**/test/resources-noncompilable/**/*</excludes>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>local-deploy</id>
      <distributionManagement>
        <repository>
          <id>com.github.sevntu-checkstyle</id>
          <name>sevntu-checks</name>
          <url>file://${deployDir}/maven2/</url>
        </repository>
      </distributionManagement>
    </profile>

    <profile>
      <!-- first part of profile is in settings.xml with defined gpg.passphrase and gpg.keyname -->
      <id>gpg</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>

  <pluginRepositories>
    <pluginRepository>
      <id>sevntu-maven</id>
      <name>sevntu-maven</name>
      <url>http://sevntu-checkstyle.github.io/sevntu.checkstyle/maven2</url>
    </pluginRepository>
  </pluginRepositories>

</project>
