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

    Copyright 2015 Sharmarke Aden.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<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>com.fitbur.testify</groupId>
    <artifactId>parent</artifactId>
    <version>0.1.3</version>
    <packaging>pom</packaging>
    
    <name>Testify</name>
    <description>
        An opinionated Java Testing Framework faithful to testing principles
        and best practices.
    </description>
    <url>https://fitburio.github.io/testify</url>

    <modules>
        <module>api</module>
        <module>core</module>
        <module>di</module>
        <module>level</module>
        <module>junit</module>
        <module>need</module>
        <module>client</module>
        <module>server</module>
        <module>examples</module>
        <module>archetype</module>
    </modules>
    
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <maven.version>3.0.5</maven.version>
        <maven.current.year>2015</maven.current.year>
        
        <!-- IDE Hints -->
        <netbeans.compile.on.save>none</netbeans.compile.on.save>
        <netbeans.checkstyle.format>true</netbeans.checkstyle.format>
        <netbeans.hint.license>apache20</netbeans.hint.license>

        <!-- Fitbur Dependency Versions -->
        <fitbur.buildtools.version>0.0.1</fitbur.buildtools.version>

        <!-- Plugin Versions -->
        <plugin.resource>2.7</plugin.resource>
        <plugin.compiler>3.3</plugin.compiler>
        <plugin.surefire>2.18.1</plugin.surefire>
        <plugin.checkstyle>2.16</plugin.checkstyle>
        <plugin.enforcer>1.4.1</plugin.enforcer>
        <plugin.source>2.4</plugin.source>
        <plugin.javadoc>2.10.3</plugin.javadoc>
        <plugin.jacoco>0.7.5.201505241946</plugin.jacoco>
        <plugin.pit>1.1.6</plugin.pit>
        <plugin.license>2.11</plugin.license>
        <plugin.sonatype>1.6.6</plugin.sonatype>
        <plugin.versions>2.2</plugin.versions>
        <plugin.gpg>1.6</plugin.gpg>

        <!-- Test Dependencies -->
        <junit.version>4.12</junit.version>
        <testng.version>6.9.6</testng.version>
        <mockito.version>2.0.40-beta</mockito.version>
        <assertj.version>3.3.0</assertj.version>

        <!-- Logging Dependencies -->
        <jansi.version>1.11</jansi.version>
        <slf4j.version>1.7.12</slf4j.version>
        <logback.version>1.1.3</logback.version>

        <!-- Servlet Dependencies -->
        <javax.inject.version>1</javax.inject.version>
        <javax.servlet.version>3.1.0</javax.servlet.version>
        <spring.version>4.2.3.RELEASE</spring.version>
        <springboot.version>1.3.2.RELEASE</springboot.version>

        <!-- Database Dependencies -->
        <hibernate.validator.version>5.2.2.Final</hibernate.validator.version>
        <javax.el.version>3.0.0</javax.el.version>
        <hibernate.version>5.1.0.Final</hibernate.version>
        <javax.transaction.version>1.2</javax.transaction.version>
        <javax.interceptor.version>1.2</javax.interceptor.version>
        <postgressql.version>9.4.1207</postgressql.version>
        <h2.version>1.4.191</h2.version>

        <!-- Misc Dependencies -->
        <checkstyle.version>6.11.1</checkstyle.version>
        <external.version>0.5.6</external.version>
    </properties>

    <prerequisites>
        <maven>${maven.version}</maven>
    </prerequisites>

    <inceptionYear>2015</inceptionYear>

    <organization>
        <name>Sharmarke Aden</name>
        <url>https://fitburio.github.io/testify</url>
    </organization>

    <developers>
        <developer>
            <id>saden1</id>
            <name>Sharmarke Aden</name>
            <timezone>-8</timezone>
            <roles>
                <role>Lead</role>
            </roles>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <issueManagement>
        <system>Github</system>
        <url>https://github.com/FitburIO/testify/issues</url>
    </issueManagement>

    <scm>
        <connection>scm:git:https://github.com/FitburIO/testify.git</connection>
        <developerConnection>scm:git:https://github.com/FitburIO/testify.git</developerConnection>
        <url>https://github.com/FitburIO/testify.git/tree/${project.scm.tag}</url>
        <tag>master</tag>
    </scm>

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

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${plugin.enforcer}</version>
                    <executions>
                        <execution>
                            <id>enforce-versions</id>
                            <goals>
                                <goal>enforce</goal>
                            </goals>
                            <configuration>
                                <rules>
                                    <requireMavenVersion>
                                        <version>[${maven.version},)</version>
                                    </requireMavenVersion>
                                    <requireJavaVersion>
                                        <version>${maven.compiler.target}</version>
                                    </requireJavaVersion>
                                    <requireProperty>
                                        <property>project.build.sourceEncoding</property>
                                        <regex>${project.build.sourceEncoding}</regex>
                                    </requireProperty>
                                </rules>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>${plugin.resource}</version>
                    <configuration>
                        <escapeString>\</escapeString>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${plugin.compiler}</version>
                    <configuration>
                        <debug>true</debug>
                        <debuglevel>lines,vars,source</debuglevel>
                        <compilerArguments>
                            <!-- enable runtime discover of parameter names -->
                            <parameters />
                        </compilerArguments>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${plugin.source}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${plugin.javadoc}</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${plugin.gpg}</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${plugin.surefire}</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${plugin.jacoco}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>report</id>
                            <phase>test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.pitest</groupId>
                    <artifactId>pitest-maven</artifactId>
                    <version>${plugin.pit}</version>
                    <executions>
                        <execution>
                            <id>pit-report</id>
                            <goals>
                                <goal>mutationCoverage</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <failWhenNoMutations>false</failWhenNoMutations>
                        <skip>${skipTests}</skip>
                        <skipTests>${skipTests}</skipTests>
                        <threads>4</threads>
                        <historyInputLocation>${project.build.directory}/pit.history</historyInputLocation>
                        <historyOutputLocation>${project.build.directory}/pit.history</historyOutputLocation>
                        <timeoutConstant>10000</timeoutConstant>
                        <targetClasses>
                            <param>com.fitbur.*</param>
                        </targetClasses>
                        <targetTests>
                            <param>com.fitbur.*</param>
                        </targetTests>
                        <excludedClasses>
                            <param>com.fitbur.*.*BadTestSetup</param>
                        </excludedClasses>
                        <exportLineCoverage>true</exportLineCoverage>
                        <outputFormats>
                            <outputFormat>HTML</outputFormat>
                        </outputFormats>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <version>${plugin.license}</version>
                    <executions>
                        <execution>
                            <id>license-check</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>com.fitbur</groupId>
                            <artifactId>build-tools</artifactId>
                            <version>${fitbur.buildtools.version}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <header>license.txt</header>
                        <properties>
                            <owner>${project.organization.name}</owner>
                            <year>${maven.current.year}</year>
                        </properties>
                        <headerDefinitions>
                            <headerDefinition>java_header_style.xml</headerDefinition>
                        </headerDefinitions>
                        <excludes>
                            <exclude>**/.*</exclude>
                            <exclude>**/*.md</exclude>
                            <exclude>**/*.txt</exclude>
                            <exclude>**/*.gpg</exclude>
                            <exclude>**/*.enc</exclude>
                            <exclude>**/*.tar</exclude>
                            <exclude>**/*.sh</exclude>
                            <exclude>**/nbactions.xml</exclude>
                            <exclude>LICENSE</exclude>
                            <exclude>src/test/resources/**</exclude>
                            <exclude>src/main/resources/**</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <version>${plugin.checkstyle}</version>
                    <executions>
                        <execution>
                            <id>validate</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <dependencies>
                        <dependency>
                            <groupId>com.fitbur</groupId>
                            <artifactId>build-tools</artifactId>
                            <version>${fitbur.buildtools.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>com.puppycrawl.tools</groupId>
                            <artifactId>checkstyle</artifactId>
                            <version>${checkstyle.version}</version>
                        </dependency>
                    </dependencies>
                    <configuration>
                        <configLocation>custom_checkstyle.xml</configLocation>
                        <consoleOutput>true</consoleOutput>
                        <failsOnError>true</failsOnError>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${plugin.versions}</version>
                    <configuration>
                        <generateBackupPoms>false</generateBackupPoms>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${plugin.sonatype}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <description>${project.version}</description>
                        <autoReleaseAfterClose>false</autoReleaseAfterClose>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>${testng.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.fitbur.external</groupId>
                <artifactId>external-guava</artifactId>
                <version>${external.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fitbur.external</groupId>
                <artifactId>external-asm</artifactId>
                <version>${external.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fitbur.external</groupId>
                <artifactId>external-bytebuddy</artifactId>
                <version>${external.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>dev</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>com.mycila</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                </plugins>

            </build>
        </profile>

        <profile>
            <id>build</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-checkstyle-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>com.mycila</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>stage</id>
            <properties>
                <skipTests>true</skipTests>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>release</id>
            <properties>
                <skipTests>true</skipTests>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <!--
                                Don't include debug information in released
                                builds but do include parameter names.
                            -->
                            <debug>false</debug>
                            <compilerArguments>
                                <parameters />
                            </compilerArguments>
                        </configuration>
                    </plugin>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <configuration>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
