<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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <groupId>com.treasuredata.client</groupId>
  <artifactId>td-client</artifactId>
  <name>Treasure Data Client for Java</name>
  <description>Treasure Data Client for Java.</description>
  <version>0.9.0</version>
  <packaging>jar</packaging>
  <url>https://github.com/treasure-data/td-client-java</url>

  <parent>
    <groupId>org.sonatype.oss</groupId>
    <artifactId>oss-parent</artifactId>
    <version>9</version>
  </parent>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <connection>scm:git:git://github.com/treasure-data/td-client-java.git</connection>
    <developerConnection>scm:git:git@github.com:treasure-data/td-client-java.git</developerConnection>
    <url>https://github.com/treasure-data/td-client-java.git</url>
    <tag>HEAD</tag>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/treasure-data/td-client-java/issues</url>
  </issueManagement>

  <developers>
    <developer>
      <id>muga</id>
      <name>Muga Nishizawa</name>
      <email>muga.nishizawa@gmail.com</email>
    </developer>
    <developer>
      <id>mcaramello</id>
      <name>Michele Caramello</name>
      <email>michele.caramello@gmail.com</email>
    </developer>
    <developer>
      <id>xerial</id>
      <name>Taro L. Saito</name>
      <email>leo@xerial.org</email>
    </developer>
  </developers>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.build.targetJdk>1.8</project.build.targetJdk>
    <project.build.jvmsize>512m</project.build.jvmsize>

    <project.check.skip-all>false</project.check.skip-all>
    <project.check.skip-dependency>${project.check.skip-all}</project.check.skip-dependency>
    <project.check.skip-dependency-version-check>${project.check.skip-all}</project.check.skip-dependency-version-check>
    <project.check.skip-findbugs>${project.check.skip-all}</project.check.skip-findbugs>

    <project.check.fail-all>true</project.check.fail-all>
    <project.check.fail-dependency>false</project.check.fail-dependency>
    <project.check.fail-dependency-version-check>${project.check.fail-all}</project.check.fail-dependency-version-check>
    <project.check.fail-findbugs>${project.check.fail-all}</project.check.fail-findbugs>

    <jetty.version>9.2.22.v20170606</jetty.version>
  </properties>

  <repositories>
    <repository>
      <id>local-repo</id>
      <url>file://${basedir}/mvn-local</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>com.googlecode.json-simple</groupId>
      <artifactId>json-simple</artifactId>
      <version>1.1.1</version>
    </dependency>

    <dependency>
      <groupId>org.msgpack</groupId>
      <artifactId>msgpack-core</artifactId>
      <version>0.8.16</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>okhttp</artifactId>
      <version>3.12.0</version>
    </dependency>

    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>okhttp-urlconnection</artifactId>
      <version>3.12.0</version>
    </dependency>

    <dependency>
      <groupId>com.squareup.okhttp3</groupId>
      <artifactId>mockwebserver</artifactId>
      <version>3.12.0</version>
      <scope>test</scope>
    </dependency>


    <dependency>
      <groupId>com.google.inject</groupId>
      <artifactId>guice</artifactId>
      <version>4.0</version>
    </dependency>

    <dependency>
      <groupId>com.google.inject.extensions</groupId>
      <artifactId>guice-multibindings</artifactId>
      <version>3.0</version>
    </dependency>

    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>21.0</version>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-core</artifactId>
      <version>2.9.9</version>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
      <version>2.9.9</version>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.core</groupId>
      <artifactId>jackson-annotations</artifactId>
      <version>2.9.9</version>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-guava</artifactId>
      <version>2.9.9</version>
    </dependency>

    <dependency>
      <groupId>com.fasterxml.jackson.datatype</groupId>
      <artifactId>jackson-datatype-json-org</artifactId>
      <version>2.9.9</version>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.12</version>
    </dependency>

    <dependency>
      <groupId>org.immutables</groupId>
      <artifactId>value</artifactId>
      <version>2.2.10</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.immutables</groupId>
      <artifactId>builder</artifactId>
      <version>2.2.10</version>
      <scope>provided</scope>
    </dependency>

    <!-- ==================== -->
    <!-- Testing dependencies -->
    <!-- ==================== -->
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.1.3</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>1.9.5</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.bigtesting</groupId>
      <artifactId>fixd</artifactId>
      <version>1.0.0</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.littleshoot</groupId>
      <artifactId>littleproxy</artifactId>
      <version>1.0.0-beta8</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.slf4j</groupId>
          <artifactId>slf4j-log4j12</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-library</artifactId>
      <version>1.3</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.exparity</groupId>
      <artifactId>hamcrest-date</artifactId>
      <version>1.1.0</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <version>2.9.4</version>
      <scope>test</scope>
    </dependency>

  </dependencies>

  <build>
    <plugins>

      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.7.0</version>
        <configuration>
          <source>${project.build.targetJdk}</source>
          <target>${project.build.targetJdk}</target>
          <encoding>${project.build.sourceEncoding}</encoding>
          <maxmem>${project.build.jvmsize}</maxmem>
          <showWarnings>true</showWarnings>
          <compilerArgument>-Xlint:unchecked</compilerArgument>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <relocations>
            <relocation>
              <pattern>com.google</pattern>
              <shadedPattern>com.treasuredata.client.com.google</shadedPattern>
            </relocation>
          </relocations>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>shade</shadedClassifierName>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.0.2</version>
        <configuration>
          <archive>
            <manifest>
            </manifest>
            <manifestEntries>
              <Specification-Version>${project.version}</Specification-Version>
              <Implementation-Version>${project.version}</Implementation-Version>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

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

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.1</version>
        <configuration>
	  <!-- This config was necessary to run tests on Circle CI -->
          <forkCount>0</forkCount>
          <argLine>${jacocoSurefireArgLine}</argLine>
          <!-- by default, test cases are included. -->
          <includes>
            <include>**/Test*.class</include>
          </includes>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-scm-plugin</artifactId>
        <version>1.9.4</version>
        <configuration>
          <pushChanges>false</pushChanges>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <encoding>${project.build.sourceEncoding}</encoding>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
          <tagNameFormat>@{project.version}</tagNameFormat>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-eclipse-plugin</artifactId>
        <version>2.9</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.8</version>
        <configuration>
          <skip>${project.check.skip-dependency}</skip>
          <failOnWarning>${project.check.fail-dependency}</failOnWarning>
          <ignoreNonCompile>true</ignoreNonCompile>
        </configuration>
        <executions>
          <execution>
            <id>default</id>
            <phase>process-test-classes</phase>
            <goals>
              <goal>analyze-only</goal>
              <goal>analyze-duplicate</goal>
              <goal>analyze-dep-mgt</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>com.ning.maven.plugins</groupId>
        <artifactId>maven-dependency-versions-check-plugin</artifactId>
        <version>2.0.2</version>
        <configuration>
          <skip>${project.check.skip-dependency-version-check}</skip>
          <failBuildInCaseOfConflict>${project.check.fail-dependency-version-check}</failBuildInCaseOfConflict>
        </configuration>
        <executions>
          <execution>
            <id>default</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.10.3</version>
        <configuration>
          <source>${project.build.targetJdk}</source>
          <encoding>${project.build.sourceEncoding}</encoding>
          <maxmemory>${project.build.jvmsize}</maxmemory>
          <additionalparam>${javadoc.opts}</additionalparam>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <phase>verify</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>findbugs-maven-plugin</artifactId>
        <version>3.0.5</version>
        <configuration>
          <skip>${project.check.skip-findbugs}</skip>
          <jvmArgs>-Xmx${project.build.jvmsize}</jvmArgs>
          <failOnError>${project.check.fail-findbugs}</failOnError>
        </configuration>
        <executions>
          <execution>
            <id>default</id>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.17</version>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <failOnViolation>true</failOnViolation>
              <consoleOutput>true</consoleOutput>
              <includeTestSourceDirectory>true</includeTestSourceDirectory>
              <configLocation>check-style.xml</configLocation>
              <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>8.18</version>
          </dependency>
        </dependencies>
      </plugin>

      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.2</version>
        <executions>
          <execution>
            <id>pre-unit-test</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
            <configuration>
              <propertyName>jacocoSurefireArgLine</propertyName>
            </configuration>
          </execution>
          <execution>
            <id>post-unit-test</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

    </plugins>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-webdav-jackrabbit</artifactId>
        <version>2.9</version>
      </extension>
    </extensions>
  </build>

  <reporting>
    <plugins>
      <!-- Generating JavaDoc -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9</version>
        <configuration>
          <doctitle>${project.name} ${project.version} API</doctitle>
          <aggregate>true</aggregate>
          <locale>en_US</locale>
          <encoding>UTF-8</encoding>
          <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
          <docletArtifact>
            <groupId>org.umlgraph</groupId>
            <artifactId>umlgraph</artifactId>
            <version>5.6</version>
          </docletArtifact>
          <additionalparam>-views -all</additionalparam>
          <useStandardDocletOptions>true</useStandardDocletOptions>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>2.5</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>2.18.1</version>
      </plugin>
    </plugins>
  </reporting>

  <profiles>
    <profile>
      <id>release-sign-artifacts</id>
      <activation>
        <property>
          <name>performRelease</name>
          <value>true</value>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.4</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <!-- Disable linting for Java8 -->
    <profile>
      <id>doclint-java8-disable</id>
      <activation>
        <jdk>[1.8,)</jdk>
      </activation>
      <properties>
        <javadoc.opts>-Xdoclint:none</javadoc.opts>
      </properties>
    </profile>
  </profiles>
</project>
