<?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">

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

    <modelVersion>4.0.0</modelVersion>

    <groupId>com.codereligion</groupId>
    <artifactId>codereligion-cherry-test</artifactId>
    <packaging>pom</packaging>
    <version>1.0.0</version>

    <modules>
        <module>hamcrest</module>
        <module>hamcrest-logback</module>
        <module>hamcrest-logback-android</module>
        <module>junit-logback</module>
        <module>junit-logback-android</module>
        <module>junit-joda-time</module>
    </modules>


    <name>Cherry-Test</name>
    <description>Contains test extensions</description>
    <url>https://github.com/codereligion/cherry-test</url>

    <developers>
        <developer>
            <id>SierraGolf</id>
            <name>Sebastian Gröbler</name>
        </developer>
    </developers>

    <scm>
        <url>scm:git:ssh://git@github.com:codereligion/cherry-test.git</url>
        <connection>scm:git:ssh://git@github.com:codereligion/cherry-test.git</connection>
        <developerConnection>scm:git:git@github.com:codereligion/cherry-test.git</developerConnection>
        <tag>codereligion-cherry-test-1.0.0</tag>
    </scm>

    <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>

    <prerequisites>
        <maven>3.0</maven>
    </prerequisites>

    <properties>
        <!-- basic maven properties -->
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!-- plugin dependencies -->
        <resources.plugin.version>2.6</resources.plugin.version>
        <compiler.plugin.version>3.1</compiler.plugin.version>
        <surefire.plugin.version>2.15</surefire.plugin.version>
        <license.plugin.version>1.9.0</license.plugin.version>
        <source.plugin.version>2.4</source.plugin.version>
        <javadoc.plugin.version>2.9.1</javadoc.plugin.version>
        <release.plugin.version>2.5.1</release.plugin.version>
        <build.helper.plugin.version>1.8</build.helper.plugin.version>
        <scm.plugin.version>1.9.2</scm.plugin.version>

        <!-- dependencies -->
        <jsr305.version>3.0.0</jsr305.version>
        <guava.version>18.0</guava.version>
        <hamcrest.version>1.3</hamcrest.version>
        <logback.classic.version>1.1.2</logback.classic.version>
        <logback.android.classic.version>1.1.1-3</logback.android.classic.version>
        <junit.version>4.12</junit.version>
        <joda.time.version>2.7</joda.time.version>
        <mockito.core.version>1.10.19</mockito.core.version>

        <!-- ci properties -->
        <jacoco.version>0.6.2.201302030002</jacoco.version>
        <skip.code.coverage>true</skip.code.coverage>

        <!-- sonar properties -->
        <sonar.language>java</sonar.language>
        <sonar.sourceEncoding>${project.build.sourceEncoding}</sonar.sourceEncoding>
        <sonar.core.codeCoveragePlugin>jacoco</sonar.core.codeCoveragePlugin>
        <sonar.jacoco.reportPath>${project.build.directory}/jacoco-ut.exec</sonar.jacoco.reportPath>
        <slf4j.api.version>1.7.6</slf4j.api.version>
    </properties>

    <build>
        <plugins>

            <!-- compilation -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler.plugin.version}</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>

                    <!-- check for warnings, fail and show if there are any -->
                    <showWarnings>true</showWarnings>
                    <compilerArgs>
                        <arg>-proc:none</arg>
                        <arg>-Werror</arg>
                        <arg>-Xlint</arg>
                        <arg>-Xlint:-options</arg>
                    </compilerArgs>
                </configuration>
            </plugin>

            <!-- code coverage -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
                <executions>
                    <execution>
                        <id>prepare-jacoco-ut</id>
                        <phase>process-test-resources</phase>
                        <configuration>
                            <!-- allows skipping of code coverage -->
                            <skip>${skip.code.coverage}</skip>

                            <!-- paths are defined by the sonar plugin -->
                            <destFile>${sonar.jacoco.reportPath}</destFile>

                            <!-- dump on test exit -->
                            <dumpOnExit>true</dumpOnExit>
                        </configuration>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- testing -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire.plugin.version}</version>
            </plugin>

            <!-- licensing -->
            <plugin>
                <groupId>com.mycila.maven-license-plugin</groupId>
                <artifactId>maven-license-plugin</artifactId>
                <version>${license.plugin.version}</version>
                <configuration>
                    <header>LICENSE_HEADER.txt</header>
                    <strictCheck>true</strictCheck>
                    <includes>
                        <include>src/</include>
                    </includes>
                </configuration>
                <executions>
                    <execution>
                        <id>check-license</id>
                        <phase>test</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- sources -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${source.plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- java doc -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${javadoc.plugin.version}</version>
                <executions>
                    <execution>
                        <id>attach-docs</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

            <!-- releasing -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${release.plugin.version}</version>
            </plugin>

        </plugins>
    </build>

    <profiles>
        <profile>
            <id>generate.license.headers</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.mycila.maven-license-plugin</groupId>
                        <artifactId>maven-license-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>format-license</id>
                                <phase>generate-sources</phase>
                                <goals>
                                    <goal>format</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <dependencies>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>${jsr305.version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>${guava.version}</version>
        </dependency>
    </dependencies>

</project>
