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

    <groupId>ru.d-shap</groupId>
    <artifactId>cli</artifactId>
    <version>1.2</version>
    <packaging>jar</packaging>

    <name>CLI tools</name>
    <description>CLI tools provide facilities for the command line interface development</description>
    <url>https://github.com/d-shap/cli</url>

    <licenses>
        <license>
            <name>GNU Lesser General Public License, Version 3</name>
            <url>https://www.gnu.org/licenses/lgpl-3.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Dmitry Shapovalov</name>
            <email>me@d-shap.ru</email>
        </developer>
    </developers>

    <scm>
        <url>https://github.com/d-shap/cli</url>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.compiler.target>1.7</maven.compiler.target>
        <maven.compiler.source>1.7</maven.compiler.source>
        <checkstyle.plugin.version>3.0.0</checkstyle.plugin.version>
        <checkstyle.version>8.18</checkstyle.version>
        <pmd.plugin.version>3.11.0</pmd.plugin.version>
        <pmd.version>6.12.0</pmd.version>
        <findbugs.plugin.version>3.0.5</findbugs.plugin.version>
        <jacoco.plugin.version>0.8.3</jacoco.plugin.version>
        <jdepend.plugin.version>2.0</jdepend.plugin.version>
        <pitest.plugin.version>1.4.6</pitest.plugin.version>
        <source.plugin.version>3.0.1</source.plugin.version>
        <javadoc.plugin.version>3.1.0</javadoc.plugin.version>
        <gpg.plugin.version>1.6</gpg.plugin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ru.d-shap</groupId>
            <artifactId>assertions</artifactId>
            <version>2.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <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.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>check-checkstyle</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <configLocation>style-strict.xml</configLocation>
                    <consoleOutput>true</consoleOutput>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                    <includeResources>true</includeResources>
                    <includeTestResources>true</includeTestResources>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <version>${pmd.plugin.version}</version>
                <dependencies>
                    <dependency>
                        <groupId>net.sourceforge.pmd</groupId>
                        <artifactId>pmd-core</artifactId>
                        <version>${pmd.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>net.sourceforge.pmd</groupId>
                        <artifactId>pmd-java</artifactId>
                        <version>${pmd.version}</version>
                    </dependency>
                </dependencies>
                <executions>
                    <execution>
                        <id>check-pmd</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>check</goal>
                            <goal>cpd-check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <printFailingErrors>true</printFailingErrors>
                    <linkXRef>false</linkXRef>
                    <verbose>true</verbose>
                    <rulesets>
                        <ruleset>pmd-strict.xml</ruleset>
                    </rulesets>
                    <ignoreAnnotations>false</ignoreAnnotations>
                    <ignoreIdentifiers>false</ignoreIdentifiers>
                    <ignoreLiterals>true</ignoreLiterals>
                    <minimumTokens>1000</minimumTokens>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <version>${findbugs.plugin.version}</version>
                <executions>
                    <execution>
                        <id>check-findbugs</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includeFilterFile>findbugs-strict.xml</includeFilterFile>
                    <effort>Max</effort>
                    <threshold>Low</threshold>
                    <xmlOutput>true</xmlOutput>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.plugin.version}</version>
                <executions>
                    <execution>
                        <id>prepare-agent-jacoco</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <includes>
                                <include>ru/d_shap/**/*</include>
                            </includes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>report-jacoco</id>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>check-jacoco</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <haltOnFailure>true</haltOnFailure>
                            <rules>
                                <rule>
                                    <element>BUNDLE</element>
                                    <limits>
                                        <limit>
                                            <counter>INSTRUCTION</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>1.0</minimum>
                                        </limit>
                                        <limit>
                                            <counter>BRANCH</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>1.0</minimum>
                                        </limit>
                                        <limit>
                                            <counter>COMPLEXITY</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>1.0</minimum>
                                        </limit>
                                        <limit>
                                            <counter>CLASS</counter>
                                            <value>MISSEDCOUNT</value>
                                            <maximum>0</maximum>
                                        </limit>
                                        <limit>
                                            <counter>METHOD</counter>
                                            <value>MISSEDCOUNT</value>
                                            <maximum>0</maximum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>build-jdepend</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>jdepend-maven-plugin</artifactId>
                        <version>${jdepend.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>generate-jdepend</id>
                                <phase>compile</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>build-pitest</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.pitest</groupId>
                        <artifactId>pitest-maven</artifactId>
                        <version>${pitest.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>mutationCoverage-pitest</id>
                                <goals>
                                    <goal>mutationCoverage</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <threads>1</threads>
                            <mutateStaticInitializers>false</mutateStaticInitializers>
                            <mutators>
                                <mutator>CONDITIONALS_BOUNDARY</mutator>
                                <mutator>INCREMENTS</mutator>
                                <mutator>INVERT_NEGS</mutator>
                                <mutator>MATH</mutator>
                                <mutator>NEGATE_CONDITIONALS</mutator>
                                <mutator>RETURN_VALS</mutator>
                                <mutator>VOID_METHOD_CALLS</mutator>
                                <mutator>CONSTRUCTOR_CALLS</mutator>
                                <mutator>EMPTY_RETURNS</mutator>
                                <mutator>FALSE_RETURNS</mutator>
                                <mutator>INLINE_CONSTS</mutator>
                                <mutator>NULL_RETURNS</mutator>
                                <mutator>NON_VOID_METHOD_CALLS</mutator>
                                <mutator>PRIMITIVE_RETURNS</mutator>
                                <mutator>REMOVE_CONDITIONALS</mutator>
                                <mutator>REMOVE_INCREMENTS</mutator>
                                <mutator>TRUE_RETURNS</mutator>
                            </mutators>
                            <failWhenNoMutations>true</failWhenNoMutations>
                            <exportLineCoverage>false</exportLineCoverage>
                            <detectInlinedCode>true</detectInlinedCode>
                            <timestampedReports>false</timestampedReports>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>build-release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${source.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>jar-source</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${javadoc.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>jar-javadoc</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <nohelp>true</nohelp>
                            <show>public</show>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${gpg.plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <keyname>(maven signature - cli)</keyname>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

</project>
