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

    <groupId>com.github.dekobon</groupId>
    <artifactId>java-triton</artifactId>
    <version>0.0.2</version>

    <name>java-triton</name>
    <description>Java Triton CloudAPI SDK</description>
    <url>https://github.com/dekobon/java-triton</url>

    <licenses>
        <license>
            <name>MPL 2.0</name>
            <url>https://www.mozilla.org/MPL/2.0/</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Elijah Zupancic</name>
            <email>elijah@zupancic.name</email>
            <organization>Joyent</organization>
            <organizationUrl>joyent.com</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/dekobon/java-triton.git</connection>
        <developerConnection>scm:git:git://github.com/dekobon/java-triton.git</developerConnection>
        <url>git@github.com:dekobon/java-triton.git</url>
        <tag>java-triton-0.0.2</tag>
    </scm>
    <issueManagement>
        <system>github.com</system>
        <url>https://github.com/dekobon/java-triton/issues</url>
    </issueManagement>
    <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>

    <properties>
        <checkstyle.skip>false</checkstyle.skip>
        <skipTests>false</skipTests>
        <java.min.version>1.7</java.min.version>
        <maven.min.version>3.0</maven.min.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <surefire.forkCount>1</surefire.forkCount>
        <surefire.useSystemClassLoader>true</surefire.useSystemClassLoader>
        <!-- Dependency versions -->
        <dependency.checkstyle.version>6.12.1</dependency.checkstyle.version>
        <dependency.java-http-signature.version>2.0.4</dependency.java-http-signature.version>
        <dependency.testng.version>6.9.9</dependency.testng.version>
        <dependency.slfj.version>1.7.7</dependency.slfj.version>
        <dependency.logback.version>1.1.3</dependency.logback.version>
        <dependency.jackson-core-version>2.7.3</dependency.jackson-core-version>
        <dependency.jackson-annotations-version>2.7.3</dependency.jackson-annotations-version>
        <dependency.jackson.version>2.7.3</dependency.jackson.version>
        <dependency.jackson-datatype-threetenbp-version>2.6.4</dependency.jackson-datatype-threetenbp-version>
        <dependency.threetenbp-version>1.3.1</dependency.threetenbp-version>
        <!-- Plugin versions -->
        <maven-checkstyle-plugin.version>2.17</maven-checkstyle-plugin.version>
        <maven-clean-plugin.version>3.0.0</maven-clean-plugin.version>
        <maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
        <maven-dependency-plugin.version>2.10</maven-dependency-plugin.version>
        <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
        <maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version>
        <maven-failsafe-plugin.version>2.19</maven-failsafe-plugin.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <maven-install-plugin.version>2.5.2</maven-install-plugin.version>
        <maven-jar-plugin.version>2.6</maven-jar-plugin.version>
        <maven-jarsigner-plugin.version>1.4</maven-jarsigner-plugin.version>
        <maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
        <maven-jxr-plugin.version>2.5</maven-jxr-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        <maven-resources-plugin.version>2.7</maven-resources-plugin.version>
        <maven-shade-plugin.version>2.4.2</maven-shade-plugin.version>
        <maven-source-plugin.version>2.4</maven-source-plugin.version>
        <maven-surefire-plugin.version>2.19</maven-surefire-plugin.version>
    </properties>

    <dependencies>
        <!-- HTTP Signatures library that allows us to authenticate -->
        <dependency>
            <groupId>com.joyent.http-signature</groupId>
            <artifactId>apache-http-client-signature</artifactId>
            <version>${dependency.java-http-signature.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Java 8 Date/Time types in Java 7 -->
        <dependency>
            <groupId>org.threeten</groupId>
            <artifactId>threetenbp</artifactId>
            <version>${dependency.threetenbp-version}</version>
        </dependency>

        <!-- JSON Serialization -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${dependency.jackson-core-version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${dependency.jackson-annotations-version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${dependency.jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.github.joschi.jackson</groupId>
            <artifactId>jackson-datatype-threetenbp</artifactId>
            <version>${dependency.jackson-datatype-threetenbp-version}</version>
        </dependency>

        <!-- We translate all commons logging calls to SLF4J -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>${dependency.slfj.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>org.slf4j</artifactId>
                    <groupId>slf4j-api</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Logback as SLF4J implementation when running tests -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${dependency.logback.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <artifactId>org.slf4j</artifactId>
                    <groupId>slf4j-api</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Guava to make life easy when testing -->
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <version>19.0</version>
            <scope>test</scope>
        </dependency>

        <!-- TestNG over Junit - just a preference... -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${dependency.testng.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!--<plugin>-->
                <!--<groupId>org.apache.maven.plugins</groupId>-->
                <!--<artifactId>maven-checkstyle-plugin</artifactId>-->
                <!--<version>${maven-checkstyle-plugin.version}</version>-->
                <!--<dependencies>-->
                    <!--<dependency>-->
                        <!--<groupId>com.puppycrawl.tools</groupId>-->
                        <!--<artifactId>checkstyle</artifactId>-->
                        <!--<version>${dependency.checkstyle.version}</version>-->
                    <!--</dependency>-->
                <!--</dependencies>-->
                <!--<configuration>-->
                    <!--<configLocation>checkstyle.xml</configLocation>-->
                    <!--<consoleOutput>true</consoleOutput>-->
                    <!--<skip>${checkstyle.skip}</skip>-->
                    <!--<suppressionsLocation>suppressions.xml</suppressionsLocation>-->
                    <!--<violationSeverity>warning</violationSeverity>-->
                <!--</configuration>-->
                <!--<executions>-->
                    <!--<execution>-->
                        <!--<id>checkstyle</id>-->
                        <!--<phase>validate</phase>-->
                        <!--<goals>-->
                            <!--<goal>check</goal>-->
                        <!--</goals>-->
                    <!--</execution>-->
                <!--</executions>-->
            <!--</plugin>-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>${maven-clean-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${maven-compiler-plugin.version}</version>
                <configuration>
                    <source>${java.min.version}</source>
                    <target>${java.min.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${maven-dependency-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven-deploy-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven-enforcer-plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>[${maven.min.version},)</version>
                                </requireMavenVersion>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven-failsafe-plugin.version}</version>
                <configuration>
                    <skipTests>${skipTests}</skipTests>
                    <forkCount>${surefire.forkCount}</forkCount>
                    <systemPropertyVariables>
                        <exampleSystemPropertyName>exampleSystemPropertyValue</exampleSystemPropertyName>
                    </systemPropertyVariables>
                    <useSystemClassLoader>${surefire.useSystemClassLoader}</useSystemClassLoader>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>${maven-gpg-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>${maven-install-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>${maven-jar-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jarsigner-plugin</artifactId>
                <version>${maven-jarsigner-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${maven-javadoc-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven-release-plugin.version}</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <localCheckout>true</localCheckout>
                    <pushChanges>false</pushChanges>
                    <releaseProfiles>release</releaseProfiles>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven-resources-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${maven-source-plugin.version}</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <forkCount>${surefire.forkCount}</forkCount>
                    <systemPropertyVariables>
                        <exampleSystemPropertyName>exampleSystemPropertyValue</exampleSystemPropertyName>
                    </systemPropertyVariables>
                    <useSystemClassLoader>${surefire.useSystemClassLoader}</useSystemClassLoader>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>${maven-jxr-plugin.version}</version>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <!--
        The release profile only needs activated when cutting a release for maven central.
        It will generate additional artifacts for javadoc and source as well as GPG signatures for each artifact.
        This profile also assumes that the properties for the gpg plugin (such as gpg.keyname and gpg.passphrase
        are either defined in a settings.xml file or similar facility.
        -->
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
