<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright (c) 2012-2020, Joyent, Inc. All rights reserved.

 This Source Code Form is subject to the terms of the Mozilla Public
 License, v. 2.0. If a copy of the MPL was not distributed with this
 file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
<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.joyent.manta</groupId>
    <artifactId>java-manta</artifactId>
    <version>3.5.0</version>
    <packaging>pom</packaging>

    <name>java-manta</name>
    <description>Java Manta SDK.</description>
    <url>https://github.com/joyent/java-manta</url>
    <inceptionYear>2012</inceptionYear>
    <organization>
        <name>Joyent</name>
        <url>joyent.com</url>
    </organization>

    <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>
            <timezone>US/Pacific</timezone>
        </developer>
        <developer>
            <name>Wyatt Lyon Preul</name>
            <organization>Joyent</organization>
            <organizationUrl>joyent.com</organizationUrl>
        </developer>
        <developer>
            <name>Chris Borroughs</name>
            <organization>Joyent</organization>
            <organizationUrl>joyent.com</organizationUrl>
        </developer>
        <developer>
            <name>Tomas Celaya</name>
            <email>tjcelaya@joyent.com</email>
            <organization>Joyent</organization>
            <organizationUrl>joyent.com</organizationUrl>
            <timezone>US/Pacific</timezone>
        </developer>
        <developer>
            <name>Ashwin A Nair</name>
            <email>ashwin.nair@joyent.com</email>
            <organization>Joyent</organization>
            <organizationUrl>joyent.com</organizationUrl>
            <timezone>US/Pacific</timezone>
        </developer>
    </developers>
    <contributors>
        <contributor>
            <name>Yunong Xiao</name>
            <email>yjxiao@gmail.com</email>
            <url>yunong.ca</url>
        </contributor>
        <contributor>
            <name>Phillip Ross</name>
            <email>phillip.w.g.ross at gmail.com</email>
            <organization>Luminosity Labs LLC</organization>
            <timezone>US/Eastern</timezone>
        </contributor>
    </contributors>

    <modules>
        <module>java-manta-client</module>
        <module>java-manta-client-unshaded</module>
        <module>java-manta-client-kryo-serialization</module>
        <module>java-manta-cli</module>
        <module>java-manta-it</module>
        <module>java-manta-benchmark</module>
        <module>java-manta-examples</module>
    </modules>

    <scm>
        <connection>scm:git:git://github.com/joyent/java-manta.git</connection>
        <developerConnection>scm:git:git://github.com/joyent/java-manta.git</developerConnection>
        <url>git@github.com:joyent/java-manta.git</url>
        <tag>java-manta-3.5.0</tag>
    </scm>
    <issueManagement>
        <system>github.com</system>
        <url>https://github.com/joyent/java-manta/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>
        <maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ss'Z'</maven.build.timestamp.format>
        <checkstyle.skip>false</checkstyle.skip>
        <java.min.version>1.8</java.min.version>
        <maven.min.version>3.1</maven.min.version>
        <maven.test.skip>false</maven.test.skip>
        <maven.integration.test.skip>false</maven.integration.test.skip>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <surefire.forkCount>1</surefire.forkCount>
        <failsafe.forkCount>1</failsafe.forkCount>
        <surefire.useSystemClassLoader>true</surefire.useSystemClassLoader>
        <failsafe.useSystemClassLoader>true</failsafe.useSystemClassLoader>
        <!-- Plugin versions -->
        <maven-checkstyle-plugin.version>3.1.1</maven-checkstyle-plugin.version>
        <maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
        <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
        <maven-dependency-plugin.version>3.1.1</maven-dependency-plugin.version>
        <maven-deploy-plugin.version>3.0.0-M1</maven-deploy-plugin.version>
        <maven-enforcer-plugin.version>3.0.0-M2</maven-enforcer-plugin.version>
        <maven-extra-enforcer-rules.version>1.1</maven-extra-enforcer-rules.version>
        <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
        <maven-install-plugin.version>3.0.0-M1</maven-install-plugin.version>
        <maven-jar-plugin.version>3.2.0</maven-jar-plugin.version>
        <maven-jarsigner-plugin.version>3.0.0</maven-jarsigner-plugin.version>
        <maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
        <maven-jxr-plugin.version>3.0.0</maven-jxr-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
        <maven-shade-plugin.version>3.2.2</maven-shade-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
        <maven-failsafe-plugin.version>2.22.2</maven-failsafe-plugin.version>
        <maven-exec-plugin.version>1.6.0</maven-exec-plugin.version>
        <maven-jacoco-plugin.version>0.8.5</maven-jacoco-plugin.version>
        <maven-project-info-reports-plugin.version>3.0.0</maven-project-info-reports-plugin.version>
        <maven-site-plugin.version>3.9.0</maven-site-plugin.version>
        <maven-replacer-plugin-plugin.version>1.5.3</maven-replacer-plugin-plugin.version>
        <maven-directory-maven-plugin.version>0.3.1</maven-directory-maven-plugin.version>
        <maven-build-helper-maven-plugin.version>3.1.0</maven-build-helper-maven-plugin.version>
        <maven-maven-resources-plugin.version>3.1.0</maven-maven-resources-plugin.version>
        <maven-spotbugs-maven-plugin.version>4.0.0</maven-spotbugs-maven-plugin.version>
        <maven-assembly-plugin.version>3.2.0</maven-assembly-plugin.version>

        <!-- Maven plugin dependency versions -->
        <maven-plexus-compiler-javac-errorprone.version>2.8.6</maven-plexus-compiler-javac-errorprone.version>
        <maven-error-prone-core.version>2.3.4</maven-error-prone-core.version>

        <!-- Dependency versions -->
        <dependency.http-client-signature.version>4.1.2</dependency.http-client-signature.version>
        <dependency.apache-http-client.version>4.5.12</dependency.apache-http-client.version>
        <dependency.bouncycastle.version>1.65</dependency.bouncycastle.version>
        <dependency.fasterxml-uuid>4.0.1</dependency.fasterxml-uuid>
        <dependency.jackson.version>2.10.3</dependency.jackson.version>
        <dependency.jnagmp.version>3.0.0</dependency.jnagmp.version>
        <dependency.urlbuilder.version>2.0.9</dependency.urlbuilder.version>

        <dependency.checkstyle.version>8.31</dependency.checkstyle.version>
        <dependency.logback.version>1.2.3</dependency.logback.version>
        <dependency.mockito.version>2.24.5</dependency.mockito.version>
        <dependency.slfj.version>1.7.29</dependency.slfj.version>
        <dependency.wiremock.version>2.24.1</dependency.wiremock.version>
        <dependency.testng.version>6.14.3</dependency.testng.version>
        <dependency.commons-collections.version>4.4</dependency.commons-collections.version>
        <dependency.commons-lang.version>3.10</dependency.commons-lang.version>
        <dependency.commons-io.version>2.6</dependency.commons-io.version>
        <dependency.commons-codec.version>1.14</dependency.commons-codec.version>
        <dependency.commons-text.version>1.8</dependency.commons-text.version>
        <dependency.commons-math.version>3.6.1</dependency.commons-math.version>
        <dependency.kryo.version>4.0.2</dependency.kryo.version>
        <dependency.objenesis.version>3.0.1</dependency.objenesis.version>
        <dependency.fast-md5.version>2.7.1</dependency.fast-md5.version>
        <dependency.cloning.version>1.9.12</dependency.cloning.version>
        <dependency.picocli.version>4.2.0</dependency.picocli.version>
        <dependency.dropwizard-metrics.version>4.1.2</dependency.dropwizard-metrics.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${dependency.slfj.version}</version>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${dependency.mockito.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.objenesis</groupId>
                    <artifactId>objenesis</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>sonatype</id>
            <name>oss-sonatype</name>
            <url>https://oss.sonatype.org/content/repositories/releases/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
    </repositories>

    <build>
        <plugins>

            <plugin>
                <!-- This property is generated so we can refer to
                     another module in a multi-module project without
                     brittle relative paths. -->
                <groupId>org.commonjava.maven.plugins</groupId>
                <artifactId>directory-maven-plugin</artifactId>
                <version>${maven-directory-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>directory-of-property</id>
                        <goals>
                            <goal>directory-of</goal>
                        </goals>
                        <phase>initialize</phase>
                        <configuration>
                            <property>multi.module.root</property>
                            <project>
                                <groupId>com.joyent.manta</groupId>
                                <artifactId>java-manta</artifactId>
                            </project>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <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>
                    <excludes>**/generated/**/*</excludes>
                </configuration>
                <executions>
                    <execution>
                        <id>checkstyle</id>
                        <phase>compile</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>
                    <compilerId>javac-with-errorprone</compilerId>
                    <forceJavacCompilerUse>true</forceJavacCompilerUse>
                    <!-- maven-compiler-plugin defaults to targeting Java 5, but our javac
                         only supports >=6 -->
                    <source>${java.min.version}</source>
                    <target>${java.min.version}</target>
                    <compilerArgs>
                        <arg>-Xdiags:verbose</arg>
                        <arg>-Xlint:all</arg>
                        <arg>-XepDisableWarningsInGeneratedCode</arg>
                    </compilerArgs>
                    <showWarnings>true</showWarnings>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.plexus</groupId>
                        <artifactId>plexus-compiler-javac-errorprone</artifactId>
                        <version>${maven-plexus-compiler-javac-errorprone.version}</version>
                    </dependency>
                    <!-- override plexus-compiler-javac-errorprone's dependency on
                         Error Prone with the latest version -->
                    <dependency>
                        <groupId>com.google.errorprone</groupId>
                        <artifactId>error_prone_core</artifactId>
                        <version>${maven-error-prone-core.version}</version>
                    </dependency>
                </dependencies>
            </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-site-plugin</artifactId>
                <version>${maven-site-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>
                    <execution>
                        <id>enforce</id>
                        <configuration>
                            <rules>
                                <dependencyConvergence />
                            </rules>
                        </configuration>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>enforce-bytecode-version</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <enforceBytecodeVersion>
                                    <maxJdkVersion>${java.min.version}</maxJdkVersion>
                                </enforceBytecodeVersion>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                    <execution>
                        <id>enforce-ban-circular-dependencies</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <banCircularDependencies />
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                    <execution>
                        <id>enforce-ban-duplicate-classes</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <banDuplicateClasses>
                                    <findAllDuplicates>true</findAllDuplicates>
                                </banDuplicateClasses>
                            </rules>
                            <fail>false</fail>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>extra-enforcer-rules</artifactId>
                        <version>${maven-extra-enforcer-rules.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven-failsafe-plugin.version}</version>
                <configuration>
                    <forkCount>${failsafe.forkCount}</forkCount>
                    <systemPropertyVariables>
                    </systemPropertyVariables>
                    <trimStackTrace>false</trimStackTrace>
                    <useSystemClassLoader>${failsafe.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>
                    <localCheckout>true</localCheckout>
                    <pushChanges>false</pushChanges>
                    <releaseProfiles>release</releaseProfiles>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <preparationGoals>clean compile jar:jar source:jar site:jar javadoc:jar</preparationGoals>
                </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-shade-plugin</artifactId>
                <version>${maven-shade-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>
                    <skip>${maven.test.skip}</skip>
                    <systemPropertyVariables>
                    </systemPropertyVariables>
                    <useSystemClassLoader>${surefire.useSystemClassLoader}</useSystemClassLoader>
                    <trimStackTrace>false</trimStackTrace>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${maven-jacoco-plugin.version}</version>
                <executions>
                    <!-- unit test coverage-->
                    <execution>
                        <id>pre-unit-test</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>unit-test-report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                    <!-- integration test coverage-->
                    <execution>
                        <id>pre-integration-test</id>
                        <goals>
                            <goal>prepare-agent-integration</goal>
                        </goals>
                        <configuration>
                            <destFile>${project.build.directory}/jacoco-it.exec</destFile>
                        </configuration>
                    </execution>
                    <execution>
                        <id>integration-test-report</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>report-integration</goal>
                        </goals>
                        <configuration>
                            <dataFileIncludes>**/jacoco-it.exec</dataFileIncludes>
                            <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.github.spotbugs</groupId>
                <artifactId>spotbugs-maven-plugin</artifactId>
                <version>${maven-spotbugs-maven-plugin.version}</version>
                <configuration>
                    <effort>max</effort>
                    <debug>true</debug>
                </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>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>report</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>${maven-project-info-reports-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>
