<?xml version="1.0"?>
<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.spotify</groupId>
  <artifactId>folsom-parent</artifactId>
  <version>1.14.0</version>
  <packaging>pom</packaging>
  <name>folsom-parent</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <skip-enforce-jdk8>true</skip-enforce-jdk8>
  </properties>

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

  <modules>
    <module>folsom</module>
    <module>folsom-semantic-metrics</module>
    <module>folsom-yammer-metrics</module>
    <module>folsom-micrometer-metrics</module>
    <module>folsom-opencensus</module>
    <module>folsom-elasticache</module>
    <module>bom</module>
  </modules>

  <scm>
    <connection>scm:git:https://github.com/spotify/folsom.git</connection>
    <developerConnection>scm:git:git@github.com:spotify/folsom.git</developerConnection>
    <url>scm:https://github.com/spotify/folsom/</url>
  </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>
      <comments>A business-friendly OSS license</comments>
    </license>
  </licenses>

  <organization>
    <name>Spotify AB</name>
    <url>http://www.spotify.com</url>
  </organization>

  <developers>
    <developer>
      <id>krka</id>
      <name>Kristofer Karlsson</name>
      <email>krka@spotify.com</email>
      <organization>Spotify AB</organization>
      <organizationUrl>http://www.spotify.com</organizationUrl>
      <roles>
        <role>developer</role>
      </roles>
      <timezone>+1</timezone>
    </developer>
  </developers>

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

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.spotify.metrics</groupId>
        <artifactId>semantic-metrics-core</artifactId>
        <version>1.0.2</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.13.1</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-core</artifactId>
        <version>3.11.2</version>
      </dependency>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers</artifactId>
        <version>1.16.3</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <profiles>
    <profile>
      <id>sonatype-oss-release</id>
      <properties>
        <skip-enforce-jdk8>false</skip-enforce-jdk8>
      </properties>
    </profile>
  </profiles>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>2.5.1</version>
          <configuration>
            <source>1.8</source>
            <target>1.8</target>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.2</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.0.0-M1</version>
          <configuration>
            <show>private</show>
          </configuration>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.eluder.coveralls</groupId>
          <artifactId>coveralls-maven-plugin</artifactId>
          <version>3.0.1</version>
          <configuration>
            <repoToken>${coveralls.token}</repoToken>
          </configuration>
        </plugin>
        <plugin>
            <groupId>com.coveo</groupId>
            <artifactId>fmt-maven-plugin</artifactId>
            <version>2.5.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>check</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <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>com.coveo</groupId>
        <artifactId>fmt-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.gaul</groupId>
        <artifactId>modernizer-maven-plugin</artifactId>
        <version>1.8.0</version>
        <configuration>
          <javaVersion>1.8</javaVersion>
        </configuration>
        <executions>
          <execution>
            <id>modernizer</id>
            <phase>verify</phase>
            <goals>
              <goal>modernizer</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- Require releases to be done with java 8-->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0-M2</version>
        <executions>
          <execution>
            <id>enforce-java</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <phase>clean</phase>
            <configuration>
              <fail>true</fail>
              <failFast>true</failFast>
              <rules>
                <requireJavaVersion>
                  <version>[1.8.0,1.9.0)</version>
                </requireJavaVersion>
              </rules>
              <skip>${skip-enforce-jdk8}</skip>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
  	    <groupId>org.codehaus.mojo</groupId>
  	    <artifactId>versions-maven-plugin</artifactId>
  	    <version>2.5</version>
  	    <configuration>
  	      <processAllModules>true</processAllModules>
  	    </configuration>
  	  </plugin>
    </plugins>
  </build>
</project>
