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

    <parent>
        <artifactId>java-manta</artifactId>
        <groupId>com.joyent.manta</groupId>
        <version>3.5.0</version>
    </parent>

    <artifactId>java-manta-client-unshaded</artifactId>
    <version>3.5.0</version>
    <packaging>jar</packaging>

    <name>java-manta-client-unshaded</name>
    <description>Java Manta Client</description>

    <dependencies>
        <!-- Library for authenticating requests against Manta -->
        <dependency>
            <groupId>com.joyent.http-signature</groupId>
            <artifactId>apache-http-client-signature</artifactId>
            <version>${dependency.http-client-signature.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>jcl-over-slf4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Library for making HTTP connections -->
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>${dependency.apache-http-client.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>commons-codec</groupId>
                    <artifactId>commons-codec</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Apache Commons Lang for helpful utility functions -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${dependency.commons-lang.version}</version>
        </dependency>

        <!-- Library for enhanced collection types -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>${dependency.commons-collections.version}</version>
        </dependency>

        <!-- Apache Commons IO for helpful IO functions -->
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${dependency.commons-io.version}</version>
        </dependency>

        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>${dependency.commons-codec.version}</version>
        </dependency>

        <!-- Library for generating more robust UUIDs -->
        <dependency>
            <groupId>com.fasterxml.uuid</groupId>
            <artifactId>java-uuid-generator</artifactId>
            <version>${dependency.fasterxml-uuid}</version>
            <exclusions>
                <exclusion>
                    <groupId>log4j</groupId>
                    <artifactId>log4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- JSON processing libraries -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${dependency.jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${dependency.jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>${dependency.jackson.version}</version>
        </dependency>

        <!-- Cryptography libraries -->
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk15on</artifactId>
            <version>${dependency.bouncycastle.version}</version>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15on</artifactId>
            <version>${dependency.bouncycastle.version}</version>
        </dependency>
        <dependency>
            <groupId>com.squareup.jnagmp</groupId>
            <artifactId>bouncycastle-rsa</artifactId>
            <version>${dependency.jnagmp.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcpkix-jdk15on</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcprov-jdk15on</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- High speed MD5 implementation -->
        <dependency>
            <groupId>com.joyent.util</groupId>
            <artifactId>fast-md5</artifactId>
            <version>${dependency.fast-md5.version}</version>
        </dependency>

        <!-- url encoding utility -->
        <dependency>
            <groupId>io.mikael</groupId>
            <artifactId>urlbuilder</artifactId>
            <version>${dependency.urlbuilder.version}</version>
        </dependency>

        <!-- object cloning library for memoization of encryption state -->
        <dependency>
            <groupId>uk.com.robust-it</groupId>
            <artifactId>cloning</artifactId>
            <version>${dependency.cloning.version}</version>
        </dependency>

        <!-- object instantiation library, needed by uk.com.robust-it:cloning
             and the kryo module  -->
        <dependency>
            <groupId>org.objenesis</groupId>
            <artifactId>objenesis</artifactId>
            <version>${dependency.objenesis.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
            <version>${dependency.commons-text.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-math3</artifactId>
            <version>${dependency.commons-math.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-core</artifactId>
            <version>${dependency.dropwizard-metrics.version}</version>
        </dependency>

        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-jmx</artifactId>
            <version>${dependency.dropwizard-metrics.version}</version>
        </dependency>

        <!-- These dependencies are declared at the module level because we can not
             inherit exclusions from the parent. -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>${dependency.logback.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>${dependency.testng.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <artifactId>junit</artifactId>
                    <groupId>junit</groupId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <skip>${maven.test.skip}</skip>
                    <suiteXmlFiles>
                        <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>
            <!-- Library that creates a properties file containing version info -->
            <plugin>
                <groupId>com.google.code.maven-replacer-plugin</groupId>
                <artifactId>replacer</artifactId>
                <version>${maven-replacer-plugin-plugin.version}</version>
                <!-- We inject the version number and date before compile -->
                <executions>
                    <execution>
                        <id>replace-version-info</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>replace</goal>
                        </goals>
                        <configuration>
                            <basedir>${project.basedir}/src/main/java</basedir>
                            <includes>
                                <include>**/MantaVersion.java</include>
                            </includes>
                            <preserveDir>true</preserveDir>
                            <replacements>
                                <replacement>
                                    <token>VERSION = ".*";</token>
                                    <value>VERSION = "${project.version}";</value>
                                </replacement>
                                <replacement>
                                    <token>DATE = Instant\..*;</token>
                                    <value>DATE = Instant.parse("${maven.build.timestamp}");</value>
                                </replacement>
                            </replacements>
                        </configuration>
                    </execution>
                    <!-- We revert the date before package so that we aren't constantly
                         checking in different versions of this file. -->
                    <execution>
                        <id>revert-version-info</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>replace</goal>
                        </goals>
                        <configuration>
                            <basedir>${project.basedir}/src/main/java</basedir>
                            <includes>
                                <include>**/MantaVersion.java</include>
                            </includes>
                            <preserveDir>true</preserveDir>
                            <replacements>
                                <replacement>
                                    <token>VERSION = ".*";</token>
                                    <value>VERSION = "${project.version}";</value>
                                </replacement>
                                <replacement>
                                    <token>DATE = Instant\..*;</token>
                                    <value>DATE = Instant.now();</value>
                                </replacement>
                            </replacements>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
