<?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.bizrateinsights</groupId>
  <artifactId>metrics-cloudwatch</artifactId>
  <version>1.3</version>

  <name>metrics-cloudwatch</name>
  <description>A Dropwizard Metrics reporter that posts to AWS CloudWatch</description>
  <url>http://github.com/bizrateinsights/metrics-cloudwatch</url>

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

  <organization>
    <name>Bizrate Insights</name>
    <url>https://github.com/bizrateinsights</url>
  </organization>

  <developers>
    <developer>
      <name>Chris McAndrews</name>
      <email>cmcandrews@bizrate.com</email>
      <organization>Bizrate Insights</organization>
      <organizationUrl>http://www.bizrateinsights.com</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/bizrateinsights/metrics-cloudwatch.git</connection>
    <developerConnection>scm:git:git@github.com:bizrateinsights/metrics-cloudwatch.git</developerConnection>
    <url>http://github.com/bizrateinsights/metrics-cloudwatch</url>
    <tag>1.3</tag>
  </scm>

  <properties>
    <default.jdk>1.6</default.jdk>
    <default.encoding>UTF-8</default.encoding>
    <!--
    duplicating the configuration above, since this is the variable automatically picked up by a lot of plugins,
    as well as things like Sonar. http://maven.apache.org/general.html#encoding-warning
    -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <coverage.target>0.88</coverage.target>

    <enforcer-plugin.version>1.4.1</enforcer-plugin.version>
    <javadoc.plugin.version>2.10.4</javadoc.plugin.version>
    <build-helper-plugin.version>1.12</build-helper-plugin.version>
    <compiler.plugin.version>3.6.1</compiler.plugin.version>
    <release.plugin.version>2.5.3</release.plugin.version>
    <pmd.plugin.version>3.7</pmd.plugin.version>
    <surefire.plugin.version>2.19.1</surefire.plugin.version>
    <checkstyle.plugin.version>2.17</checkstyle.plugin.version>
    <maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
    <pit.version>1.1.11</pit.version>
    <jacoco.version>0.7.8</jacoco.version>
    <coverage.exclude>**/wiring/**</coverage.exclude>
    <integration.coverage.exclude>**/model/**</integration.coverage.exclude>
    <sonar.jacoco.excludes>**/wiring/**</sonar.jacoco.excludes>
    <sonar.exclusions>**/wiring/**</sonar.exclusions>

    <cloudwatch-sdk.version>1.11.77</cloudwatch-sdk.version>
    <guava.version>19.0</guava.version>
    <guava-testlib.version>19.0</guava-testlib.version>
    <hamcrest.version>1.3</hamcrest.version>
    <junit.version>4.12</junit.version>
    <metrics.version>3.1.2</metrics.version>
    <mockito.version>1.10.19</mockito.version>
    <powermock.version>1.6.4</powermock.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <!-- Conflicts spotted by the enforcer -->
      <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.2</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>io.dropwizard.metrics</groupId>
      <artifactId>metrics-core</artifactId>
      <version>${metrics.version}</version>
    </dependency>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-cloudwatch</artifactId>
      <version>${cloudwatch-sdk.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava.version}</version>
    </dependency>
    <!-- Testing -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava-testlib</artifactId>
      <version>${guava-testlib.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>${mockito.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-core</artifactId>
      <version>${powermock.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-module-junit4</artifactId>
      <version>${powermock.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.powermock</groupId>
      <artifactId>powermock-api-mockito</artifactId>
      <version>${powermock.version}</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.mockito</groupId>
          <artifactId>mockito-all</artifactId>
        </exclusion>
        <exclusion>
          <groupId>org.hamcrest</groupId>
          <artifactId>hamcrest-core</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${compiler.plugin.version}</version>
          <configuration>
            <source>${default.jdk}</source>
            <target>${default.jdk}</target>
            <encoding>${default.encoding}</encoding>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${release.plugin.version}</version>
          <configuration>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <tagNameFormat>@{project.version}</tagNameFormat>
            <useReleaseProfile>false</useReleaseProfile>
            <releaseProfiles>sign-artifact</releaseProfiles>
            <goals>deploy</goals>
          </configuration>
        </plugin>
        <!-- Sonar uses these versions, below -->
        <plugin>
          <artifactId>maven-pmd-plugin</artifactId>
          <version>${pmd.plugin.version}</version>
          <configuration>
            <targetJdk>${default.jdk}</targetJdk>
            <sourceEncoding>${default.encoding}</sourceEncoding>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>${checkstyle.plugin.version}</version>
          <configuration>
            <encoding>${default.encoding}</encoding>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${surefire.plugin.version}</version>
          <configuration>
            <!-- for powermockito jdk7 support -->
            <!-- JDK8 does not have the UseSplitVerifier flag -->
            <!-- -XX:-UseSplitVerifier -->
            <argLine>-noverify ${argLine}</argLine>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>${javadoc.plugin.version}</version>
          <configuration>
            <encoding>${default.encoding}</encoding>
            <failOnError>false</failOnError>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <!--
        This is a mutation testing tool for evaluating the quality of unit tests.  It can be a
        little slow, so its not a viable drop-in replacement for a coverage tool like jacoco,
        however it is very useful in development for catching unit tests that only bump coverage
        and don't verify behavior.
        To run the tests and generate a report use: mvn org.pitest:pitest-maven:mutationCoverage
        The reports will be under target/pit-reports/<timestamp>/index.html
      -->
      <plugin>
        <groupId>org.pitest</groupId>
        <artifactId>pitest-maven</artifactId>
        <version>${pit.version}</version>
        <configuration>
          <targetClasses>
            <param>com.bizrateinsights.*</param>
          </targetClasses>
          <targetTests>
            <param>com.bizrateinsights.*</param>
          </targetTests>
          <excludedClasses>
            <excludedClass>com.bizrateinsights.*wiring*</excludedClass>
            <excludedClass>com.bizrateinsights.*acceptance*</excludedClass>
          </excludedClasses>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco.version}</version>
        <executions>
          <execution>
            <id>prepare-agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>prepare-agent-integration</id>
            <goals>
              <goal>prepare-agent-integration</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>report</goal>
            </goals>
            <configuration>
              <excludes>
                <exclude>${coverage.exclude}</exclude>
              </excludes>
            </configuration>
          </execution>
          <execution>
            <id>report-integration</id>
            <phase>prepare-package</phase>
            <goals>
              <goal>report-integration</goal>
            </goals>
            <configuration>
              <excludes>
                <exclude>${coverage.exclude}</exclude>
                <exclude>${integration.coverage.exclude}</exclude>
              </excludes>
            </configuration>
          </execution>
          <execution>
            <id>check</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <excludes>
                <exclude>${coverage.exclude}</exclude>
              </excludes>
              <rules>
                <rule>
                  <element>BUNDLE</element>
                  <limits>
                    <limit>
                      <counter>LINE</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>${coverage.target}</minimum>
                    </limit>
                    <limit>
                      <counter>BRANCH</counter>
                      <value>COVEREDRATIO</value>
                      <minimum>${coverage.target}</minimum>
                    </limit>
                  </limits>
                </rule>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>${build-helper-plugin.version}</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <configuration>
              <removeAll>false</removeAll>
            </configuration>
            <goals>
              <goal>remove-project-artifact</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- Ensure that source code is packaged and deployed for inclusion into IDEs -->
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <argLine>${argLine}</argLine>
        </configuration>
        <executions>
          <execution>
            <id>default-test</id>
            <goals>
              <goal>test</goal>
            </goals>
            <phase>test</phase>
            <configuration>
              <excludes>
                <exclude>**/*IntegrationTest.java</exclude>
              </excludes>
              <includes>
                <include>**/*Test.java</include>
              </includes>
            </configuration>
          </execution>
          <execution>
            <id>integration-test</id>
            <goals>
              <goal>test</goal>
            </goals>
            <phase>integration-test</phase>
            <configuration>
              <includes>
                <include>**/*IntegrationTest.java</include>
              </includes>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${enforcer-plugin.version}</version>
        <executions>
          <execution>
            <id>enforce-versions</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireUpperBoundDeps />
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <!-- Ensure that a javadoc jar is being generated and deployed -->
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>sign-artifact</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
    </repository>
  </distributionManagement>
</project>
