<?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/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
        <relativePath/>
    </parent>

    <groupId>org.specsy</groupId>
    <artifactId>parent</artifactId>
    <version>2.3.3</version>
    <packaging>pom</packaging>

    <description>
        Specsy is a BDD-style unit-level testing framework for Java/Scala/Groovy.
        It safely isolates mutable state and supports writing self-documenting tests/specifications.
    </description>
    <url>http://specsy.org/</url>
    <inceptionYear>2010</inceptionYear>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <jumi.version>0.5.437</jumi.version>
        <scala.version>2.10.7</scala.version>
        <junit-platform.version>1.3.2</junit-platform.version>
        <junit-jupiter.version>5.3.2</junit-jupiter.version>
        <junit-vintage.version>5.3.2</junit-vintage.version>
        <junit4.version>4.12</junit4.version>
        <hamcrest.version>1.3</hamcrest.version>
    </properties>

    <prerequisites>
        <maven>3.2</maven>
    </prerequisites>

    <licenses>
        <license>
            <name>Apache License 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Esko Luontola</name>
            <url>http://luontola.fi</url>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/luontola/specsy.git</connection>
        <developerConnection>scm:git:git@github.com:luontola/specsy.git</developerConnection>
        <url>http://github.com/luontola/specsy/tree</url>
    </scm>

    <dependencies>

        <!-- Testing -->

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-library</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Integration Testing with Jumi -->

        <dependency>
            <groupId>fi.jumi</groupId>
            <artifactId>jumi-core</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>org.specsy</groupId>
                <artifactId>specsy-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.specsy</groupId>
                <artifactId>specsy-core</artifactId>
                <version>${project.version}</version>
                <type>test-jar</type>
            </dependency>

            <dependency>
                <groupId>org.specsy</groupId>
                <artifactId>specsy-junit</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.specsy</groupId>
                <artifactId>specsy-java</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.specsy</groupId>
                <artifactId>specsy-groovy</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.specsy</groupId>
                <artifactId>specsy-scala_2.10</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Jumi -->

            <dependency>
                <groupId>fi.jumi</groupId>
                <artifactId>jumi-api</artifactId>
                <version>${jumi.version}</version>
            </dependency>

            <dependency>
                <groupId>fi.jumi</groupId>
                <artifactId>jumi-core</artifactId>
                <version>${jumi.version}</version>
            </dependency>

            <!-- TODO: remove this boostrap when Jumi can be run without it -->
            <dependency>
                <groupId>fi.jumi</groupId>
                <artifactId>jumi-launcher</artifactId>
                <version>${jumi.version}</version>
            </dependency>

            <!-- Groovy -->

            <dependency>
                <groupId>org.codehaus.groovy</groupId>
                <artifactId>groovy</artifactId>
                <version>2.4.6</version>
            </dependency>

            <!-- Scala -->

            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                <version>${scala.version}</version>
            </dependency>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-compiler</artifactId>
                <version>${scala.version}</version>
            </dependency>

            <!-- Testing -->

            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>${junit4.version}</version>
            </dependency>

            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-engine</artifactId>
                <version>${junit-platform.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-launcher</artifactId>
                <version>${junit-platform.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-console</artifactId>
                <version>${junit-platform.version}</version>
            </dependency>

            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit-jupiter.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.vintage</groupId>
                <artifactId>junit-vintage-engine</artifactId>
                <version>${junit-vintage.version}</version>
            </dependency>

            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-library</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-core</artifactId>
                <version>${hamcrest.version}</version>
            </dependency>

            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-core</artifactId>
                <version>1.10.19</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>

            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <includes>
                        <include>**/*Test.class</include>
                        <include>**/*Spec.class</include>
                    </includes>
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                    <jvm>${env.JAVA7_HOME}/bin/java</jvm>
                </configuration>
            </plugin>

            <plugin>
                <artifactId>maven-enforcer-plugin</artifactId>
                <!-- XXX: cannot set version in <pluginManagement> because of inheriting oss-parent -->
                <version>1.4.1</version>
                <executions>
                    <execution>
                        <id>enforce-multiple-java-versions</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireEnvironmentVariable>
                                    <variableName>JAVA7_HOME</variableName>
                                </requireEnvironmentVariable>
                                <requireEnvironmentVariable>
                                    <variableName>JAVA8_HOME</variableName>
                                </requireEnvironmentVariable>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>

        <pluginManagement>
            <plugins>

                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>2.6.1</version>
                </plugin>

                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.codehaus.groovy</groupId>
                            <artifactId>groovy-eclipse-compiler</artifactId>
                            <version>2.9.2-01</version>
                        </dependency>
                        <dependency>
                            <groupId>org.codehaus.groovy</groupId>
                            <artifactId>groovy-eclipse-batch</artifactId>
                            <version>2.4.3-01</version>
                        </dependency>
                    </dependencies>
                </plugin>

                <plugin>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.7</version>
                </plugin>

                <plugin>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.6</version>
                </plugin>

                <plugin>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.18.1</version>
                </plugin>

                <plugin>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.4</version>
                </plugin>

                <plugin>
                    <artifactId>maven-install-plugin</artifactId>
                    <version>2.5.2</version>
                </plugin>

                <plugin>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>2.8.2</version>
                </plugin>

                <plugin>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.4</version>
                </plugin>

                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>1.6.5</version>
                    <configuration>
                        <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                        <serverId>ossrh-releases-org.specsy</serverId>
                        <stagingProfileId>492c010f84f38e</stagingProfileId>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>net.orfjackal.retrolambda</groupId>
                    <artifactId>retrolambda-maven-plugin</artifactId>
                    <version>2.1.0</version>
                </plugin>

                <plugin>
                    <groupId>net.alchim31.maven</groupId>
                    <artifactId>scala-maven-plugin</artifactId>
                    <version>3.2.2</version>
                    <configuration>
                        <args>
                            <arg>-feature</arg>
                        </args>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.pitest</groupId>
                    <artifactId>pitest-maven</artifactId>
                    <version>1.1.5</version>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>coverage-report</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.pitest</groupId>
                        <artifactId>pitest-maven</artifactId>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>mutationCoverage</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <threads>4</threads>
                            <jvmArgs>
                                <arg>-ea</arg>
                            </jvmArgs>
                            <targetClasses>
                                <pattern>org.specsy.*</pattern>
                            </targetClasses>
                            <targetTests>
                                <pattern>org.specsy.*</pattern>
                            </targetTests>
                            <failWhenNoMutations>false</failWhenNoMutations>
                            <timestampedReports>false</timestampedReports>
                            <mutators>
                                <mutator>ALL</mutator>
                            </mutators>
                            <detectInlinedCode>true</detectInlinedCode>
                            <mutateStaticInitializers>true</mutateStaticInitializers>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
