<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.opsmatters</groupId>
  <artifactId>bitly-java-api</artifactId>
  <version>1.0.4</version>
  <packaging>jar</packaging>
  <name>Bitly Java API</name>
  <description>
    Java client library to execute operations on URLs using the Bitly API.
  </description>
  <url>https://github.com/opsmatters/bitly-java-api</url>

  <issueManagement>
    <url>https://github.com/opsmatters/bitly-java-api/issues</url>
    <system>GitHub Issues</system>
  </issueManagement>

  <licenses>
    <license>
      <name>Apache 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.html</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <scm>
    <url>https://github.com/opsmatters/bitly-java-api</url>
    <connection>scm:git:https://github.com/opsmatters/bitly-java-api.git</connection>
    <developerConnection>scm:git:https://github.com/opsmatters/bitly-java-api.git</developerConnection>
    <tag>bitly-java-api-1.0.4</tag>
  </scm>

  <developers>
    <developer>
      <id>opsdemon</id>
      <email>gerald@opsmatters.com</email>
      <name>Gerald Curley</name>
      <url>https://github.com/opsmatters</url>
      <organization>http://opsmatters.com</organization>
    </developer>
  </developers>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
  </properties>

  <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>

  <build>

    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>

    <filters>
      <filter>${basedir}/target/filter.properties</filter>
    </filters>

    <plugins>

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.3</version>
      <configuration>
        <source>1.8</source>
        <target>1.8</target>
        <fork>true</fork>
        <debug>on</debug>
        <meminitial>128m</meminitial>
        <maxmem>512m</maxmem>
        <compilerArgs>
          <arg>-XDignore.symbol.file</arg>
          <arg>-Xmaxerrs</arg>
          <arg>1000</arg>
        </compilerArgs>
        <useIncrementalCompilation>yes</useIncrementalCompilation>
        <excludes>
          <exclude>**/package-info.java</exclude>
        </excludes>
      </configuration>
    </plugin>

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <mkdir dir="${project.build.directory}" />
                <tstamp>
                  <format property="TODAY" pattern="dd-MM-yyyy HH:mm" timezone="Europe/London" /> 
                </tstamp>
                <property file="${basedir}/src/main/resources/build.number" />
                <echo file="${basedir}/target/filter.properties">build.number=${build.number}
built.on=${TODAY}
                </echo>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <useDefaultManifestFile>true</useDefaultManifestFile>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.1.1</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <source>8</source>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.20.1</version>
        <configuration>
          <systemPropertyVariables>
            <bitly.access_token>${bitly.access_token}</bitly.access_token>
            <java.util.logging.config.file>${project.build.directory}/test-classes/logging.properties</java.util.logging.config.file>
          </systemPropertyVariables>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>1.5</version>
        <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-release-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <useReleaseProfile>false</useReleaseProfile>
          <releaseProfiles>release</releaseProfiles>
          <goals>deploy</goals>
          <arguments>-Dbitly.access_token=${bitly.access_token}</arguments>
        </configuration>
      </plugin>

    </plugins>

  </build>

  <reporting>
    <plugins>

      <plugin> 
        <artifactId>maven-javadoc-plugin</artifactId> 
        <version>3.1.1</version> 
        <configuration> 
          <outputDirectory>${basedir}/apidocs</outputDirectory> 
          <show>private</show>
          <windowtitle>Bitly API Documentation</windowtitle>
          <breakiterator>true</breakiterator>
          <maxmemory>512m</maxmemory>
          <header><![CDATA[<h1>Bitly API v${project.version}</h1>]]></header> 
          <bottom>
            <![CDATA[<i>Copyright &#169; opsmatters 2020. All Rights Reserved.</i>]]>
          </bottom>
          <quiet>true</quiet>
          <additionalJOptions>
            <additionalJOption>-J-Xmx512m</additionalJOption>
          </additionalJOptions>
        </configuration> 
      </plugin> 

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.6</version>
      </plugin>

    </plugins>
  </reporting>

<dependencies>

<dependency>
  <groupId>com.google.code.gson</groupId>
  <artifactId>gson</artifactId>
  <version>2.8.6</version>
</dependency>

<dependency>
  <groupId>com.google.guava</groupId>
  <artifactId>guava</artifactId>
  <version>29.0-jre</version>
    <exclusions>
      <exclusion>
        <groupId>com.google.code.findbugs</groupId>
        <artifactId>jsr305</artifactId>
      </exclusion>
      <exclusion>
        <groupId>com.google.errorprone</groupId>
        <artifactId>error_prone_annotations</artifactId>
      </exclusion>
      <exclusion>
        <groupId>com.google.j2objc</groupId>
        <artifactId>j2objc-annotations</artifactId>
      </exclusion>
      <exclusion>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-annotations</artifactId>
      </exclusion>
    </exclusions>
</dependency>

<dependency>
  <groupId>org.apache.httpcomponents</groupId>
  <artifactId>httpclient</artifactId>
  <version>4.5.9</version>
</dependency>

<dependency>
  <groupId>org.apache.httpcomponents</groupId>
  <artifactId>httpcore</artifactId>
  <version>4.4.11</version>
</dependency>

<dependency>
  <groupId>org.apache.commons</groupId>
  <artifactId>commons-lang3</artifactId>
  <version>3.8.1</version>
</dependency>

<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.12</version>
  <scope>test</scope>
</dependency>

</dependencies>

</project>
