<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (C) 2015  Karl Bennett
  ~
  ~ This program is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ (at your option) 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 General Public License for more details.
  ~
  ~ You should have received a copy of the GNU General Public License
  ~ along with this program.  If not, see <http://www.gnu.org/licenses />.
  -->

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

    <licenses>
        <license>
            <name>GNU GENERAL PUBLIC LICENSE, Version 3</name>
            <url>http://www.gnu.org/licenses/</url>
        </license>
    </licenses>

    <modelVersion>4.0.0</modelVersion>

    <prerequisites>
        <maven>2.2.1</maven>
    </prerequisites>

    <groupId>com.github.shiver-me-timbers</groupId>
    <artifactId>smt-parent-pom</artifactId>
    <version>1.3</version>

    <packaging>pom</packaging>

    <name>${project.artifactId}</name>

    <description>This is the parent pom that is used by all the shiver-me-timbers projects.</description>

    <url>http://shiver-me-timbers.github.io/smt-parent-pom/</url>

    <developers>
        <developer>
            <name>Karl Bennett</name>
            <email>karl.bennett.smt@gmail.com</email>
            <organization>shiver-me-timbers</organization>
            <organizationUrl>https://github.com/shiver-me-timbers</organizationUrl>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <jacoco.version>0.7.4.201502262128</jacoco.version>
        <javadoc.version>2.10.2</javadoc.version>
        <!-- This slf4j property is here so that it can be reused to synchronise the versions in child projects. -->
        <slf4j.version>1.7.12</slf4j.version>
        <!-- The github server credential configuration id. -->
        <github.global.server>github</github.global.server>
    </properties>

    <profiles>
        <profile>
            <!-- Profile for promoting the Maven site to the Github ghpages branch. -->
            <id>github</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.github</groupId>
                        <artifactId>site-maven-plugin</artifactId>
                        <version>0.11</version>
                        <configuration>
                            <message>Creating github site for ${project.version}</message>
                            <noJekyll>true</noJekyll>
                        </configuration>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>site</goal>
                                </goals>
                                <phase>site</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <!-- Profile for promoting artifacts to Maven central. -->
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <!-- (Required for Maven Central) Make sure the source JAR is created. -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.4</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <!-- (Required for Maven Central) Enable the generation of JavaDocs. -->
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${javadoc.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <!-- (Required for Maven Central) Make sure to sign all artifacts so that they can be verified. -->
                        <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>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <pluginManagement>
            <!-- Optional plugins. -->
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>3.3</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.apache.maven.doxia</groupId>
                            <artifactId>doxia-module-markdown</artifactId>
                            <version>1.5</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <!-- Set the version of the reports plugin to use. -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>2.8</version>
                </plugin>
                <plugin>
                    <!-- Enable Jacoco test coverage reports. -->
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco.version}</version>
                    <configuration>
                        <includes>
                            <include>shiver.me.timbers.*</include>
                        </includes>
                    </configuration>
                    <executions>
                        <execution>
                            <!-- Enable instrumentation of the code before the tests run. -->
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <!-- Compulsory plugins. -->
            <plugin>
                <!--Make sure we compile all the Java source as 1.7.-->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <compilerVersion>1.7</compilerVersion>
                    <fork>true</fork>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>
            <plugin>
                <!-- Set the version of the release plugin to use. -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <!-- Configure the Maven source control report. -->
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <webAccessUrl>https://github.com/shiver-me-timbers/${project.artifactId}</webAccessUrl>
                </configuration>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>scm</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <!-- Configure the linking of the JavaDoc and Jacoco reports in the generated Maven site. -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${javadoc.version}</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>javadoc</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
            </dependency>
            <dependency>
                <groupId>org.hamcrest</groupId>
                <artifactId>hamcrest-all</artifactId>
                <version>1.3</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-all</artifactId>
                <version>1.10.19</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

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

    <scm>
        <connection>scm:git:https://github.com/shiver-me-timbers/${project.artifactId}.git</connection>
        <developerConnection>scm:git:git@github.com:shiver-me-timbers/${project.artifactId}.git</developerConnection>
        <url>https://github.com/shiver-me-timbers/${project.artifactId}</url>
        <tag>smt-parent-pom-1.3</tag>
    </scm>
</project>
