<?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.brkt</groupId>
    <artifactId>brkt-sdk-java</artifactId>
    <version>0.9.2</version>

    <!-- These elements are required for deployment to Maven Central. -->
    <name>${project.groupId}:${project.artifactId}</name>
    <description>Bracket Computing Java SDK</description>
    <url>https://github.com/brkt/brkt-sdk-java</url>
    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Boris Burtin</name>
            <email>boris@brkt.com</email>
            <organization>Bracket Computing</organization>
            <organizationUrl>http://www.brkt.com</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git@github.com:brkt/brkt-sdk-java.git</connection>
        <developerConnection>scm:git:git@github.com:brkt/brkt-sdk-java.git</developerConnection>
        <url>git@github.com:brkt/brkt-sdk-java.git</url>
    </scm>

    <build>
        <plugins>
            <!-- Use JDK 6 for Android compatibility. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <!-- Create a self-executing JAR that contains dependencies. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.4.1</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <artifactSet>
                                <excludes>
                                    <exclude>junit:junit</exclude>
                                    <exclude>com.google.code.findbugs:jsr305</exclude>
                                </excludes>
                            </artifactSet>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <mainClass>com.brkt.client.util.Main</mainClass>
                                </transformer>
                            </transformers>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>jar-with-dependencies</shadedClassifierName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- Build a JAR with sources. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.4</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- JavaDoc. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.10.3</version>
                <configuration>
                    <excludePackageNames>com.brkt.thirdparty</excludePackageNames>
                    <doctitle>Bracket Computing Java SDK 1.0</doctitle>
                    <overview>overview.html</overview>
                    <notimestamp>true</notimestamp>
                    <!--
                        Check all lint groups except "missing".  This avoids warnings for
                        method arguments that don't specify @param.
                        The integration test comments out the -Xdoclint params so that
                        the build works on JDK 7.  The <additionalparam> open and close
                        tags need to be on the same line, in order for this to work.
                    -->
                    <additionalparam>-Xdoclint:accessibility</additionalparam>
                    <additionalparam>-Xdoclint:html</additionalparam>
                    <additionalparam>-Xdoclint:syntax</additionalparam>
                    <additionalparam>-Xdoclint:reference</additionalparam>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <!--
            Current disk usage for dependent jars: 230KB for Gson, 300KB for Apache Commons Codec,
            90KB for JCommander, and 650K for JodaTime (after compression).
            If this becomes a problem for Android, the client application could trim down the
            dependencies as described in:
              https://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html
              http://ant.apache.org/manual/dirtasks.html
        -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <!-- JSON serialization -->
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.3.1</version>
        </dependency>
        <!-- ISO 8601 date parsing -->
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>2.7</version>
        </dependency>
        <!-- Base64 encoding for auth -->
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
            <version>1.10</version>
        </dependency>
        <!-- CLI options parsing -->
        <dependency>
            <groupId>com.beust</groupId>
            <artifactId>jcommander</artifactId>
            <version>1.48</version>
        </dependency>
        <!-- Guava depends on JSR 305 -->
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>1.3.9</version>
        </dependency>
    </dependencies>
</project>
