<?xml version="1.0" encoding="UTF-8"?>
<!--

    Shadowhunt PMD Rulesets - Extended PMD Rulesets
    Copyright © 2018 shadowhunt (dev@shadowhunt.de)

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.

-->
<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>

    <groupId>de.shadowhunt</groupId>
    <artifactId>pmd-rulesets</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>

    <!-- project information {{{1 -->
    <name>Shadowhunt PMD Rulesets</name>
    <description>Extended PMD Rulesets</description>
    <url>https://dev.shadowhunt.de/pmd-rulesets</url>
    <inceptionYear>2018</inceptionYear>

    <organization>
        <name>shadowhunt</name>
        <url>https://dev.shadowhunt.de</url>
    </organization>

    <licenses>
        <license>
            <name>The GNU General Public License, Version 3.0</name>
            <url>http://www.gnu.org/licenses/gpl-3.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>thrawn</id>
            <name>Alexander Dreweke</name>
            <email>thrawn@shadowhunt.de</email>
            <timezone>Europe/Berlin</timezone>
        </developer>
    </developers>
    <!-- }}}1 -->

    <!-- environment information {{{1 -->
    <scm>
        <connection>scm:git:https://scm.shadowhunt.de/pmd-rulesets.git</connection>
        <developerConnection>scm:git:https://scm.shadowhunt.de/pmd-rulesets.git</developerConnection>
        <tag>HEAD</tag>
        <url>https://github.com/thrawn-sh/pmd-rulesets</url>
    </scm>

    <distributionManagement>
        <repository>
            <id>sonatype</id>
            <name>Sonatype (Maven Central) Staging Repository</name>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
        </repository>
        <snapshotRepository>
            <id>shadowhunt</id>
            <name>Shadowhunt Local Snapshot Repository</name>
            <url>https://maven.shadowhunt.de/local-snapshot</url>
        </snapshotRepository>
        <site>
            <id>shadowhunt.site</id>
            <url>scp://dev.shadowhunt.de/sites/pmd-rulesets</url>
        </site>
    </distributionManagement>
    <!-- }}}1 -->

    <properties>
        <jacoco.itReportPath>${project.basedir}/target/jacoco-it.exec</jacoco.itReportPath>
        <jacoco.utReportPath>${project.basedir}/target/jacoco-ut.exec</jacoco.utReportPath>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <version.pmd>6.4.0</version.pmd>
    </properties>

    <!-- dependencies {{{1 -->
    <dependencies>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>annotations</artifactId>
            <version>3.0.1u2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>de.shadowhunt</groupId>
            <artifactId>annotations</artifactId>
            <version>2.1.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-core</artifactId>
            <version>${version.pmd}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-java</artifactId>
            <version>${version.pmd}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.sourceforge.pmd</groupId>
            <artifactId>pmd-test</artifactId>
            <version>${version.pmd}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <!-- }}}1 -->

    <build>
        <defaultGoal>install</defaultGoal>

        <!-- plugins {{{1 -->
        <plugins>
            <plugin>
                <groupId>com.github.ekryd.sortpom</groupId>
                <artifactId>sortpom-maven-plugin</artifactId>
                <version>2.8.0</version>
                <configuration>
                    <createBackupFile>false</createBackupFile>
                    <keepBlankLines>true</keepBlankLines>
                    <nrOfIndentSpace>4</nrOfIndentSpace>
                    <sortDependencies>groupId,artifactId</sortDependencies>
                    <sortPlugins>groupId,artifactId</sortPlugins>
                    <sortProperties>true</sortProperties>
                    <sortModules>true</sortModules>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.mycila</groupId>
                <artifactId>license-maven-plugin</artifactId>
                <version>3.0</version>
                <executions>
                    <execution>
                        <phase>process-sources</phase>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <excludes>
                        <exclude>**/.*</exclude>
                        <exclude>Jenkinsfile</exclude>
                        <exclude>LICENSE</exclude>
                        <exclude>README</exclude>
                    </excludes>
                    <header>com/mycila/maven/plugin/license/templates/GPL-3.txt</header>
                    <properties>
                        <owner>${project.organization.name}</owner>
                        <project.inceptionYear>${build.copyright.year}</project.inceptionYear>
                        <email>dev@shadowhunt.de</email>
                    </properties>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.redhat.rcm.maven.plugin</groupId>
                <artifactId>buildmetadata-maven-plugin</artifactId>
                <version>1.7.0</version>
                <executions>
                    <execution>
                        <phase>initialize</phase>
                        <goals>
                            <goal>provide-buildmetadata</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <buildDatePattern>yyyy-MM-dd</buildDatePattern>
                    <createPropertiesReport>false</createPropertiesReport>
                    <createXmlReport>false</createXmlReport>
                    <forceNewProperties>true</forceNewProperties>
                </configuration>
            </plugin>
            <plugin>
                <groupId>de.shadowhunt.maven.plugins</groupId>
                <artifactId>package-info-maven-plugin</artifactId>
                <version>2.0.0</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>package-info</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <packages>
                        <package>
                            <annotations>
                                <annotation>@de.shadowhunt.annotation.ReturnValuesAreNonnullByDefault</annotation>
                                <annotation>@javax.annotation.ParametersAreNonnullByDefault</annotation>
                            </annotations>
                        </package>
                    </packages>
                    <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>3.1.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>verify</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <configLocation>assets/dev/checkstyle.xml</configLocation>
                    <headerLocation>LICENSE</headerLocation>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                    <suppressionsLocation>assets/dev/checkstyle-suppressions.xml</suppressionsLocation>
                    <violationSeverity>warning</violationSeverity>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.1.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <compilerArgument>-Xlint:all</compilerArgument>
                    <failOnWarning>true</failOnWarning>
                    <proc>none</proc>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>3.1.1</version>
                <executions>
                    <execution>
                        <id>analyze</id>
                        <goals>
                            <goal>analyze-only</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <failOnWarning>true</failOnWarning>
                    <outputXML>true</outputXML>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M2</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.3.9</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.22.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <argLine>${jacoco.agent.argLineIT}</argLine>
                    <printSummary>false</printSummary>
                </configuration>
            </plugin>
            <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>
                <configuration>
                    <!-- shadowhunt package -->
                    <keyname>77103E0B</keyname>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-help-plugin</artifactId>
                <version>3.1.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5.2</version>
                <configuration>
                    <createChecksum>true</createChecksum>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <archive>
                        <index>true</index>
                        <manifest>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                        <manifestEntries>
                            <Built-By>dev@shadowhunt.de</Built-By>
                            <Implementation-Build>${build.version.full}</Implementation-Build>
                        </manifestEntries>
                    </archive>
                    <skipIfEmpty>true</skipIfEmpty>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-javadoc</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <!-- helpmojo generates javadoc with self-closing tags -->
                    <doclint>none</doclint>
                    <quiet>true</quiet>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>3.10.0</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <linkXRef>false</linkXRef>
                    <printFailingErrors>true</printFailingErrors>
                    <excludeRoots>
                        <excludeRoot>target</excludeRoot>
                    </excludeRoots>
                    <rulesets>
                        <ruleset>assets/dev/pmd.xml</ruleset>
                    </rulesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.3</version>
                <configuration>
                    <tagNameFormat>v@{project.version}</tagNameFormat>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.1.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-scm-plugin</artifactId>
                <version>1.10.0</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.7.1</version>
                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.wagon</groupId>
                        <artifactId>wagon-ssh</artifactId>
                        <version>3.1.0</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>3.0.1</version>
                <executions>
                    <execution>
                        <id>attach-source</id>
                        <phase>package</phase>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.22.0</version>
                <configuration>
                    <printSummary>false</printSummary>
                    <argLine>${jacoco.agent.argLineUT}</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>animal-sniffer-maven-plugin</artifactId>
                <version>1.17</version>
                <executions>
                    <execution>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <signature>
                        <groupId>org.codehaus.mojo.signature</groupId>
                        <artifactId>java18</artifactId>
                        <version>1.0</version>
                    </signature>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>3.0.5</version>
                <executions>
                    <execution>
                        <id>verify</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <effort>Max</effort>
                    <xmlOutput>true</xmlOutput>
                    <excludeFilterFile>assets/dev/findbugs-exclude.xml</excludeFilterFile>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>2.7</version>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.2</version>
                <executions>
                    <execution>
                        <id>ut</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <propertyName>jacoco.agent.argLineUT</propertyName>
                            <destFile>${jacoco.utReportPath}</destFile>
                        </configuration>
                    </execution>
                    <execution>
                        <id>it</id>
                        <phase>initialize</phase>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <propertyName>jacoco.agent.argLineIT</propertyName>
                            <destFile>${jacoco.itReportPath}</destFile>
                        </configuration>
                    </execution>
                    <execution>
                        <id>merge</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>merge</goal>
                        </goals>
                        <configuration>
                            <fileSets>
                                <fileSet>
                                    <directory>${project.build.directory}</directory>
                                    <includes>
                                        <include>jacoco-*.exec</include>
                                    </includes>
                                </fileSet>
                            </fileSets>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <includes>
                        <include>de/shadowhunt/pmd/**</include>
                    </includes>
                </configuration>
            </plugin>
        </plugins>
        <!-- }}}1 -->
    </build>
</project>
