<?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.crabs-hue.commons</groupId>
        <artifactId>commons-dependencies</artifactId>
        <version>0.9.0</version>
        <relativePath>../commons-dependencies/pom.xml</relativePath>
    </parent>

    <artifactId>commons-parent</artifactId>

    <name>commons-parent</name>
    <description>Parent project for Crabs Hue common libraries, and possibly other projects. Defines some default
        dependencies and build plugins.
    </description>
    <packaging>pom</packaging>

    <properties>
        <jdk>1.8</jdk>
        <maven.compiler.source>${jdk}</maven.compiler.source>
        <maven.compiler.target>${jdk}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.test.skip>false</maven.test.skip>
        <maven.javadoc.skip>false</maven.javadoc.skip>
        <spotbugs.skip>false</spotbugs.skip>
        <pit.skip>true</pit.skip>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
        </dependency>
        <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.pitest</groupId>
                <artifactId>pitest-maven</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.pitest</groupId>
                        <artifactId>pitest-junit5-plugin</artifactId>
                        <version>${pitest.junit5.version}</version>
                    </dependency>
                </dependencies>
                <configuration>
                    <skip>${pit.skip}</skip>
                </configuration>
                <executions>
                    <execution>
                        <id>mutationCoverage</id>
                        <goals>
                            <goal>mutationCoverage</goal>
                        </goals>
                        <configuration>
                            <skip>${pit.skip}</skip>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.0.1</version>
                <reportSets>
                    <reportSet>
                        <id>non-aggregate</id>
                        <reports>
                            <report>javadoc</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <configuration>
                    <skipSurefireReport>${maven.test.skip}</skipSurefireReport>
                </configuration>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>no-javadoc</id>
            <properties>
                <maven.javadoc.skip>true</maven.javadoc.skip>
            </properties>
        </profile>
        <profile>
            <id>no-test</id>
            <properties>
                <maven.test.skip>true</maven.test.skip>
            </properties>
        </profile>
        <profile>
            <id>no-spotbugs</id>
            <properties>
                <spotbugs.skip>true</spotbugs.skip>
            </properties>
        </profile>
        <profile>
            <id>mutation-tests</id>
            <properties>
                <pit.skip>false</pit.skip>
            </properties>
        </profile>
    </profiles>

    <scm>
        <connection>scm:git:https://github.com/crabs-hue/crabs-hue-commons-java.git</connection>
        <developerConnection>scm:git:https://github.com/crabs-hue/crabs-hue-commons-java.git
        </developerConnection>
        <url>https://github.com/crabs-hue/crabs-hue-commons-java.git</url>
    </scm>

</project>
