<?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.spotify.metrics</groupId>
  <artifactId>semantic-metrics-parent</artifactId>
  <version>1.1.6</version>
  <name>Semantic Metrics: Parent POM</name>
  <packaging>pom</packaging>

  <description>
    Semantic Metrics: Parent POM
  </description>

  <developers>
    <developer>
      <id>udoprog</id>
      <name>John-John Tedro</name>
      <email>udoprog@spotify.com</email>
    </developer>
  </developers>

  <url>https://github.com/spotify/semantic-metrics</url>

  <scm>
    <connection>scm:git:git://github.com/spotify/semantic-metrics.git</connection>
    <developerConnection>scm:git:git@github.com:spotify/semantic-metrics.git
    </developerConnection>
    <url>https://github.com/spotify/semantic-metrics</url>
    <tag>1.1.6</tag>
  </scm>

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

  <modules>
    <module>api</module>
    <module>core</module>
    <module>ffwd-reporter</module>
    <module>ffwd-http-reporter</module>
    <module>examples</module>
    <module>guava</module>
    <module>remote</module>
    <module>semantic-metrics-bom</module>
  </modules>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <metrics.version>4.0.2</metrics.version>
    <tdunning.tdigest.version>3.2</tdunning.tdigest.version>
    <com.google.protobuf.version>3.11.1</com.google.protobuf.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.spotify.metrics</groupId>
        <artifactId>semantic-metrics-api</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>com.spotify.metrics</groupId>
        <artifactId>semantic-metrics-core</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>com.spotify.metrics</groupId>
        <artifactId>semantic-metrics-ffwd-reporter</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>com.spotify.metrics</groupId>
        <artifactId>semantic-metrics-ffwd-http-reporter</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-core</artifactId>
        <version>${metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-jvm</artifactId>
        <version>${metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>com.tdunning</groupId>
        <artifactId>t-digest</artifactId>
        <version>${tdunning.tdigest.version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.25</version>
      </dependency>

      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>26.0-jre</version>
      </dependency>
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>${com.google.protobuf.version}</version>
      </dependency>
      <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>1.9.5</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>com.squareup.okhttp3</groupId>
        <artifactId>okhttp</artifactId>
        <version>3.3.1</version>
      </dependency>
      <dependency>
        <groupId>com.squareup.okhttp3</groupId>
        <artifactId>mockwebserver</artifactId>
        <version>3.3.1</version>
      </dependency>
      <dependency>
        <groupId>com.spotify</groupId>
        <artifactId>futures-extra</artifactId>
        <version>4.1.1</version>
      </dependency>
      <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.10.0.pr1</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
          </plugin>
          <plugin>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.3</version>
            <configuration>
              <tagNameFormat>@{project.version}</tagNameFormat>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.3</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </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>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>jdk8</id>
      <activation>
        <jdk>1.8</jdk>
      </activation>
      <properties>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
      </properties>
    </profile>
    <profile>
      <id>jdk9+</id>
      <activation>
        <jdk>[9,)</jdk>
      </activation>
      <properties>
        <!-- Javac introduced the "release" option only in Java 9+.  It
			properly sets up source, target and boot classpath for the best
			compatibility with different versions of Java. -->
        <maven.compiler.release>8</maven.compiler.release>
      </properties>
    </profile>
  </profiles>

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
          <configuration>
            <showWarnings>true</showWarnings>
            <compilerArgs>
              <compilerArg>-Xlint:all</compilerArg>
            </compilerArgs>
          </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.2.0</version>
        <configuration>
          <source>8</source>
          <doclint>none</doclint>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.1.0</version>
        <configuration>
          <configLocation>checkstyle.xml</configLocation>
          <consoleOutput>true</consoleOutput>
          <failOnViolation>true</failOnViolation>
          <failsOnError>true</failsOnError>
          <maxAllowedViolations>0</maxAllowedViolations>
          <propertyExpansion>basedir=${user.dir}</propertyExpansion>
          <excludes>**/LockFreeExponentiallyDecayingReservoir.java</excludes>
        </configuration>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <failOnViolation>true</failOnViolation>
              <failsOnError>true</failsOnError>
            </configuration>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>8.29</version>
          </dependency>
        </dependencies>
      </plugin>
    </plugins>
  </build>
</project>
