<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright (c) Codice Foundation
 *
 * This is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either
 * version 3 of the License, or 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 Lesser General Public License for more details. A copy of the GNU Lesser General Public License is distributed along with this program and can be found at
 * <http://www.gnu.org/licenses/lgpl.html>.
 *
 **/
-->
<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>org.codice.test</groupId>
    <artifactId>codice-test</artifactId>
    <version>0.2</version>
    <packaging>pom</packaging>
    <name>Codice Test</name>
    <description>Codice Generic Test Utilities and Classes</description>

    <inceptionYear>2018</inceptionYear>
    <organization>
        <name>Codice Foundation</name>
        <url>http://codice.org</url>
    </organization>
    <licenses>
        <license>
            <name>GNU Lesser General Public v3</name>
            <url>http://www.gnu.org/licenses/lgpl.html</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <!--  default URL properties -->
        <codice.scm.connection.url />
        <snapshots.repository.url />
        <reports.repository.url />

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>

        <codice-maven.version>0.1</codice-maven.version>

        <commons-lang.version>2.6</commons-lang.version>
        <guava.version>23.0</guava.version>
        <jsr305.version>3.0.2_1</jsr305.version>
        <org.slf4j.version>1.7.1</org.slf4j.version>
        <jodah-failsafe.version>0.9.5</jodah-failsafe.version>
        <logback.version>1.2.3</logback.version>
        <logback.classic.version>1.2.3</logback.classic.version>

        <junit.version>4.12</junit.version>
        <spock.version>1.1-groovy-2.4</spock.version>
        <groovy.version>2.4.7</groovy.version>
        <mockito-core.version>2.8.47</mockito-core.version>
        <hamcrest-all.version>1.3</hamcrest-all.version>

        <javassist.version>3.22.0-GA</javassist.version>

        <!-- Gitflow Incremental Builder Properties -->
        <gib.referenceBranch>refs/remotes/origin/master</gib.referenceBranch>
        <gib.baseBranch>HEAD</gib.baseBranch>
        <gib.enabled>false</gib.enabled>
        <gib.failOnError>false</gib.failOnError>

        <!-- Maven Plugin Version Properties -->
        <maven-jacoco-plugin.version>0.8.1</maven-jacoco-plugin.version>
    </properties>

    <scm>
        <url>https://github.com/codice/codice-test</url>
        <connection>scm:git:https://github.com/codice/codice-test.git</connection>
        <developerConnection>scm:git:https://github.com/codice/codice-test.git</developerConnection>
        <tag>codice-test-0.2</tag>
    </scm>

    <distributionManagement>
        <!--
        NOTE: The properties snapshots.repository.url and releases.repository.url should be defined in your .m2/settings.xml file.
        -->
        <snapshotRepository>
            <id>snapshots</id>
            <url>${snapshots.repository.url}</url>
        </snapshotRepository>
        <repository>
            <id>releases</id>
            <url>${releases.repository.url}</url>
        </repository>
        <site>
            <id>reports</id>
            <url>${reports.repository.url}</url>
        </site>
    </distributionManagement>

    <repositories>
        <repository>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>codice</id>
            <name>Codice Repository</name>
            <url>https://artifacts.codice.org/content/groups/public/</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>central</id>
            <name>Central Repository</name>
            <url>https://repo.maven.apache.org/maven2</url>
            <layout>default</layout>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>codice</id>
            <name>Codice Repository</name>
            <url>https://artifacts.codice.org/content/groups/public/</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.apache.servicemix.bundles</groupId>
                <artifactId>org.apache.servicemix.bundles.jsr305</artifactId>
                <version>${jsr305.version}</version>
                <scope>provided</scope>
            </dependency>

            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>${commons-lang.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${org.slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>net.jodah</groupId>
                <artifactId>failsafe</artifactId>
                <version>${jodah-failsafe.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</artifactId>
                <version>${logback.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.classic.version}</version>
            </dependency>

            <dependency>
                <groupId>org.javassist</groupId>
                <artifactId>javassist</artifactId>
                <version>${javassist.version}</version>
            </dependency>

            <dependency>
                <!--Hamcrest first, then JUnit, then Mockito. See http://goo.gl/e5bJA5-->
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
                <version>${hamcrest-all.version}</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>${mockito-core.version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-all</artifactId>
                <version>${groovy.version}</version>
                <type>pom</type>
            </dependency>
            <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy-all</artifactId>
                <version>${groovy.version}</version>
            </dependency>
            <dependency>
                <groupId>org.spockframework</groupId>
                <artifactId>spock-core</artifactId>
                <version>${spock.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.codehaus.groovy</groupId>
                        <artifactId>groovy-all</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <extensions>
            <extension>
                <groupId>com.vackosar.gitflowincrementalbuilder</groupId>
                <artifactId>gitflow-incremental-builder</artifactId>
                <version>3.4</version>
            </extension>
        </extensions>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.0.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.2.2</version>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${maven-jacoco-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.codice.maven</groupId>
                            <artifactId>jacoco</artifactId>
                            <version>${codice-maven.version}</version>
                        </dependency>
                    </dependencies>
                    <executions>
                        <execution>
                            <id>default-prepare-agent</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.20.1</version>
                    <configuration>
                        <argLine>${argLine} -Djava.awt.headless=true -noverify</argLine>
                        <includes>
                            <include>**/*Test.java</include>
                            <include>**/*Spec.class</include>
                        </includes>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>com.coveo</groupId>
                <artifactId>fmt-maven-plugin</artifactId>
                <version>2.0.0</version>
                <executions>
                    <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.codehaus.gmavenplus</groupId>
                <artifactId>gmavenplus-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>default-check</id>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <haltOnFailure>true</haltOnFailure>
                            <rules>
                                <rule>
                                    <element>BUNDLE</element>
                                    <limits>
                                        <limit implementation="org.codice.jacoco.LenientLimit">
                                            <counter>INSTRUCTION</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.75</minimum>
                                        </limit>
                                        <limit implementation="org.codice.jacoco.LenientLimit">
                                            <counter>BRANCH</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.75</minimum>
                                        </limit>
                                        <limit implementation="org.codice.jacoco.LenientLimit">
                                            <counter>COMPLEXITY</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.75</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
    </profiles>

    <modules>
        <module>spock-all</module>
        <module>junit-extensions</module>
        <module>hamcrest-extensions</module>
        <module>mockito-extensions</module>
        <module>spock-extensions</module>
        <module>failsafe-controller</module>
    </modules>
</project>
