
<!-- Parent Pom for all skuzzle GitHub Projects -->

<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.skuzzle</groupId>
    <artifactId>skuzzle-parent</artifactId>
    <version>1.3.7</version>
    <packaging>pom</packaging>
    <url>http://www.skuzzle.de/maven/</url>

    <name>skuzzle-parent</name>
    <description>Parent POM for all skuzzle GitHub Projects</description>
    <inceptionYear>2014</inceptionYear>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <github.name>skuzzle-parent</github.name>
        <site.name>skuzzle-parent</site.name>

        <!-- Name of the SCM profile in the settings.xml -->
        <project.scm.id>github</project.scm.id>

        <!-- Tests -->
        <skipIT>false</skipIT>
        <skipMT>true</skipMT>

        <!-- Java Version -->
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.compiler.source>1.8</maven.compiler.source>

        <!-- Versions -->
        <javadoc.version>3.0.1</javadoc.version>
        <jacoco.version>0.8.1</jacoco.version>
        <sonar.maven.version>3.4.1.1168</sonar.maven.version>
        <pitest.version>1.4.0</pitest.version>

        <!-- Dependency Analyzer -->
        <!-- Fail if dependencies have not been declared explicitly -->
        <failOnWarning>true</failOnWarning>

        <!-- FTP Site Deploy -->
        <ftp.id>skuzzle-ftp</ftp.id>
        <ftp.url>ftp://skuzzle.de</ftp.url>
        <ftp.basePath>html/maven</ftp.basePath>
        
        <!-- Nexus Deploy -->
        <skipDeploy>false</skipDeploy>

        <!-- Sonar Qube -->
        <sonar.language>java</sonar.language>
        <sonar.skipPackageDesign>true</sonar.skipPackageDesign>
        <sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>

        <sonar.jacoco.reportPath>${project.build.directory}/jacoco.exec</sonar.jacoco.reportPath>
        <sonar.jacoco.itReportPath>${project.build.directory}/jacoco-it.exec</sonar.jacoco.itReportPath>
    </properties>

    <licenses>
        <license>
            <name>The MIT License (MIT)</name>
            <url>http://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <!-- GitHub Issues, CI and SCM -->
    <issueManagement>
        <system>GitHub</system>
        <url>http://github.com/skuzzle/${github.name}/issues</url>
    </issueManagement>

    <ciManagement>
        <system>Travis-CI</system>
        <url>https://travis-ci.org/skuzzle/${github.name}</url>
    </ciManagement>

    <scm>
        <connection>scm:git:git://github.com/skuzzle/${github.name}.git</connection>
        <developerConnection>scm:git:https://github.com/skuzzle/${github.name}.git</developerConnection>
        <url>https://github.com/skuzzle/${github.name}</url>
        <tag>v1.3.7</tag>
    </scm>

    <developers>
        <developer>
            <id>simon</id>
            <name>Simon Taddiken</name>
            <email>github@skuzzle.de</email>
            <roles>
                <role>architect</role>
                <role>developer</role>
            </roles>
            <properties>
                <picUrl>http://www.random.skuzzle.de/fuck_yeah.png</picUrl>
            </properties>
        </developer>
    </developers>

    <distributionManagement>
        <snapshotRepository>
            <id>sonatype-nexus-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>sonatype-nexus-staging</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <site>
            <id>skuzzle-ftp</id>
            <name>${site.name}</name>
            <url>${ftp.url}/${ftp.basePath}/</url>
        </site>
    </distributionManagement>

    <repositories>
        <!-- Enable OSS Sonatype SNAPSHOTS -->
        <repository>
            <id>snapshots-repo</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <build>
        <extensions>
            <!-- Enable FTP deployment for reports -->
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-ftp</artifactId>
                <version>3.1.0</version>
            </extension>
        </extensions>

        <pluginManagement>
            <plugins>
                <!-- Compile sources -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.7.0</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <target>${maven.compiler.target}</target>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>sonar-maven-plugin</artifactId>
                    <version>${sonar.maven.version}</version>
                </plugin>

                <!-- Generate project's site -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.7.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>3.0.0</version>
                </plugin>

                <!-- Deploy test Coverage to Coveralls -->
				<plugin>
					<groupId>org.eluder.coveralls</groupId>
					<artifactId>coveralls-maven-plugin</artifactId>
					<version>4.3.0</version>
					<dependencies>
						<dependency>
							<groupId>javax.xml.bind</groupId>
							<artifactId>jaxb-api</artifactId>
							<version>2.2.3</version>
						</dependency>
					</dependencies>
				</plugin>
                <!-- Configure test coverage -->
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco.version}</version>
                    <executions>
                        <execution>
                            <id>prepare-code-coverage-unit-tests</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>prepare-code-coverage-integration-tests</id>
                            <goals>
                                <goal>prepare-agent-integration</goal>
                            </goals>
                            <configuration>
                                <append>true</append>
                                <skip>${skipIT}</skip>
                                <destFile>${sonar.jacoco.itReportPath}</destFile>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <!-- Mutation testing -->
                <plugin>
                    <groupId>org.pitest</groupId>
                    <artifactId>pitest-maven</artifactId>
                    <version>${pitest.version}</version>
                    <configuration>
                        <skip>${skipMT}</skip>
                        <targetClasses>
                            <param>de.skuzzle.*</param>
                        </targetClasses>
                        <targetTests>
                            <param>de.skuzzle.*</param>
                        </targetTests>
                        <outputFormats>
                            <outputFormat>XML</outputFormat>
                        </outputFormats>
                    </configuration>
                    <executions>
                        <execution>
                            <id>mutation-tests</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>mutationCoverage</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- package java doc into jar file -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${javadoc.version}</version>
                    <executions>
                        <execution>
                            <id>fix-java-doc</id>
                            <goals>
                                <goal>fix</goal>
                            </goals>
                            <configuration>
                                <defaultAuthor>Simon Taddiken</defaultAuthor>
                                <defaultVersion>${project.version}</defaultVersion>
                                <excludes>**/*Test.java,**/*IT.java</excludes>
                                <fixTags />
                            </configuration>
                        </execution>
                        <execution>
                            <id>attach-javadocs</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- package sources into jar file -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.0.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-war-plugin</artifactId>
                    <version>3.2.2</version>
                </plugin>
                <!-- Package tests into jar file -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.1.0</version>
                    <configuration>
                        <archive>                   
                            <manifest>
                                <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                                <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            </manifest>
                        </archive>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-tests</id>
                            <phase>package</phase>
                            <goals>
                                <goal>test-jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- Dependency Analysis: force explicit dependency declaration -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.1.1</version>
                    <executions>
                        <execution>
                            <id>analyze-dependencies</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>analyze-only</goal>
                            </goals>
                            <configuration>
                                <ignoreNonCompile>true</ignoreNonCompile>
                                <failOnWarning>true</failOnWarning>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <!-- Unit Tests -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.22.0</version>
                </plugin>
                <!-- Integration Tests -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>2.22.0</version>
                    <executions>
                        <execution>
                            <id>integration-test</id>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                
                <!-- Add Integration Test source folder -->
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>3.0.0</version>
                    <executions>
                        <execution>
                            <id>add-it-sources</id>
                            <goals>
                                <goal>add-test-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>${project.basedir}/src/it/java</source>
                                </sources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <!-- Signing artifacts -->
                <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>
                            <configuration>
                                <useAgent>false</useAgent>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <!-- Deploy to Sonatype -->
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.8</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>sonatype-nexus-snapshots</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        <skipNexusStagingDeployMojo>${skipDeploy}</skipNexusStagingDeployMojo>
                    </configuration>
                </plugin>
                <!-- Perform Release -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>2.5.3</version>
                    <configuration>
                        <mavenExecutorId>forked-path</mavenExecutorId>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <useReleaseProfile>true</useReleaseProfile>
                        <releaseProfiles>release</releaseProfiles>
                        <prepareGoals>deploy</prepareGoals>
                        <tagNameFormat>v@{project.version}</tagNameFormat>
                    </configuration>
                </plugin>
                <!-- package release files -->
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.4</version>
                    <configuration>
                        <ignoreMissingDescriptor>true</ignoreMissingDescriptor>
                        <appendAssemblyId>false</appendAssemblyId>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <!-- Compiler activated for all -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <!-- Dependency analysis activated for all modules -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
            </plugin>
            <!-- Coverage activated for all modules -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
            <!-- Mutation tests for all -->
            <plugin>
                <groupId>org.pitest</groupId>
                <artifactId>pitest-maven</artifactId>
            </plugin>
            <!-- integration test source folders for all -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <!-- Generate JavaDoc Reports -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <id>report-java-doc</id>
                        <reports>
                            <report>javadoc</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <!-- Generate Coverage Reports -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <reportSets>
                    <reportSet>
                        <id>report-coverage</id>
                        <reports>
                            <report>report</report>
                            <report>report-integration</report>
                        </reports>
                        <configuration>
                            <sourceEncoding>${project.build.sourceEncoding}</sourceEncoding>
                        </configuration>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>skuzzle.release</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <!-- Enable signing and sonatype deploy -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                    <!-- Enable javadoc and source artifact (required for maven deploy) -->
					<!-- package java doc into jar file -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-javadoc-plugin</artifactId>
					</plugin>
					<!-- package sources into jar file -->
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-source-plugin</artifactId>
					</plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>