<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright (C) 2019 ITRS Group Ltd. All rights reserved. -->
<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.itrsgroup.collection</groupId>
  <artifactId>statsd-client</artifactId>
  <version>2.1.1</version>
  <packaging>jar</packaging>
  <name>Statsd Java Client</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <jdk.version>1.8</jdk.version>
    <sonar.projectName>statsd-client-java</sonar.projectName>
    <sonar.coverage.exclusions>**/NoOp*Client.java</sonar.coverage.exclusions>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.13.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>2.28.2</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>3.0.0-M1</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <filesets>
            <fileset>
              <directory>src/generated</directory>
              <includes>
                <include>*/**</include>
              </includes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.0</version>
        <configuration>
          <source>${jdk.version}</source>
          <target>${jdk.version}</target>
          <compilerArgument>-Xlint:deprecation,unchecked</compilerArgument>
          <failOnError>true</failOnError>
          <failOnWarning>true</failOnWarning>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.17</version>
        <configuration>
          <consoleOutput>true</consoleOutput>
          <failOnViolation>true</failOnViolation>
          <violationSeverity>warning</violationSeverity>
        </configuration>
        <executions>
          <execution>
            <id>checkstyle-main</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <sourceDirectory>src/main/java</sourceDirectory>
              <configLocation>checkstyle.xml</configLocation>
            </configuration>
          </execution>
          <execution>
            <id>checkstyle-test</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <sourceDirectory>src/test/java</sourceDirectory>
              <configLocation>checkstyle-test.xml</configLocation>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.1.1</version>
        <executions>
          <execution>
            <id>unpack-datamodel</id>
            <goals>
              <goal>unpack</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>com.itrsgroup.platform</groupId>
                  <artifactId>platform-datamodel</artifactId>
                  <version>2.1.1</version>
                  <classifier>sources</classifier>
                </artifactItem>
              </artifactItems>
              <includes>
                com/itrsgroup/platform/datamodel/Severity.java,
                com/itrsgroup/platform/datamodel/Unit.java
              </includes>
              <outputDirectory>src/generated/java</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>src/generated/java</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>3.1.2</version>
        <configuration>
          <archive>
            <manifestEntries>
              <Premain-Class>com.itrsgroup.collection.instr.jvm.JvmMetricsAgent</Premain-Class>
            </manifestEntries>
            <addMavenDescriptor>false</addMavenDescriptor>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <source>${jdk.version}</source>
          <failOnError>true</failOnError>
          <failOnWarnings>true</failOnWarnings>
        </configuration>
        <executions>
          <execution>
            <id>build-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>0.8.4</version>
        <executions>
          <execution>
            <id>agent</id>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <!-- IDs must match server IDs in settings.xml -->
  <distributionManagement>
    <snapshotRepository>
      <id>nexus-snapshots</id>
      <url>https://nexus.itrsgroup.com/repository/snapshots</url>
    </snapshotRepository>
    <repository>
      <id>itrs-public</id>
      <url>https://maven.itrsgroup.com/repository/public</url>
    </repository>
  </distributionManagement>
</project>
