<?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.groupon.dse</groupId>
    <artifactId>spark-metrics</artifactId>
    <packaging>jar</packaging>
    <version>2.0.0</version>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>A library to expose more of Apache Spark's metrics system</description>
    <url>https://github.com/groupon/spark-metrics</url>

    <licenses>
        <license>
            <name>The BSD 3-Clause License</name>
            <url>https://opensource.org/licenses/BSD-3-Clause</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Atsunori Kakitani</name>
            <email>atkakitani@groupon.com</email>
            <organization>Groupon</organization>
            <organizationUrl>http://www.groupon.com</organizationUrl>
        </developer>
        <developer>
            <id>Rakesh Nair</id>
            <email>rakesh@groupon.com</email>
            <organization>Groupon</organization>
            <organizationUrl>http://www.groupon.com</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@github.com:groupon/spark-metrics.git</connection>
        <developerConnection>scm:git:git@github.com:groupon/spark-metrics.git</developerConnection>
        <url>https://github.com/groupon/spark-metrics</url>
        <tag>spark-metrics-2.0.0</tag>
    </scm>

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

    <parent>
        <groupId>org.basepom</groupId>
        <artifactId>basepom-oss</artifactId>
        <version>18</version>
    </parent>

    <properties>
        <!-- Dependencies -->
        <dropwizard.version>3.1.2</dropwizard.version>
        <scala.compat.version>2.11</scala.compat.version>
        <spark.version>2.0.1</spark.version>
        <jetty.version>8.1.14.v20131031</jetty.version>
        <scalatest.version>2.2.6</scalatest.version>

        <!-- Plugins -->
        <dep.plugin.scalatest-maven-plugin.version>1.0</dep.plugin.scalatest-maven-plugin.version>
        <dep.plugin.scalastyle-maven-plugin.version>0.6.0</dep.plugin.scalastyle-maven-plugin.version>

        <!-- Basepom Overrides -->
        <dep.scala.version>2.11.8</dep.scala.version>
        <dep.plugin.scala.version>3.2.2</dep.plugin.scala.version>
        <basepom.release.push-changes>true</basepom.release.push-changes>
        <basepom.check.fail-duplicate-finder>false</basepom.check.fail-duplicate-finder>
        <basepom.check.fail-findbugs>false</basepom.check.fail-findbugs>
        <basepom.oss.skip-scala-doc>false</basepom.oss.skip-scala-doc>
        <project.build.targetJdk>1.8</project.build.targetJdk>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>scala-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>scala-compile-first</id>
                        <phase>process-resources</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>scala-test-compile-first</id>
                        <phase>process-test-resources</phase>
                        <goals>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>attach-scaladocs</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>doc-jar</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <jvmArgs>
                        <jvmArg>-Xms64m</jvmArg>
                        <jvmArg>-Xmx1024m</jvmArg>
                    </jvmArgs>
                    <scalaVersion>${dep.scala.version}</scalaVersion>
                    <scalaCompatVersion>${scala.compat.version}</scalaCompatVersion>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest-maven-plugin</artifactId>
                <version>${dep.plugin.scalatest-maven-plugin.version}</version>
                <configuration>
                    <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
                    <junitxml>.</junitxml>
                    <filereports>WDF TestSuite.txt</filereports>
                </configuration>
                <executions>
                    <execution>
                        <id>test</id>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.scalastyle</groupId>
                <artifactId>scalastyle-maven-plugin</artifactId>
                <version>${dep.plugin.scalastyle-maven-plugin.version}</version>
                <configuration>
                    <verbose>false</verbose>
                    <failOnViolation>true</failOnViolation>
                    <includeTestSourceDirectory>false</includeTestSourceDirectory>
                    <failOnWarning>false</failOnWarning>
                    <sourceDirectory>src/main/scala</sourceDirectory>
                    <testSourceDirectory>src/test/scala</testSourceDirectory>
                    <configLocation>src/main/resources/scalastyle_config.xml</configLocation>
                    <outputFile>scalastyle_output.xml</outputFile>
                    <outputEncoding>UTF-8</outputEncoding>
                </configuration>
                <executions>
                    <execution>
                        <phase>compile</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <configuration>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                                <exclude>META-INF/*.RSA</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
            </plugin>
        </plugins>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.mycila</groupId>
                    <artifactId>license-maven-plugin</artifactId>
                    <configuration>
                        <excludes>
                            <exclude>**/pom.xml</exclude>
                            <exclude>**/scalastyle_config.xml</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${dep.plugin.release.version}</version>
                    <configuration>
                        <useReleaseProfile>true</useReleaseProfile>
                        <releaseProfiles>basepom.oss-release</releaseProfiles>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencies>
        <dependency>
            <groupId>io.dropwizard.metrics</groupId>
            <artifactId>metrics-core</artifactId>
            <version>${dropwizard.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_2.11</artifactId>
            <version>${spark.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-streaming_2.11</artifactId>
            <version>${spark.version}</version>
            <scope>provided</scope>

            <exclusions>
                <exclusion>
                    <groupId>org.apache.zookeeper</groupId>
                    <artifactId>zookeeper</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.scala-lang</groupId>
            <artifactId>scala-library</artifactId>
            <version>${dep.scala.version}</version>
            <scope>provided</scope>
        </dependency>

        <!--
        We need to include this for some reason because of the way we fake the Spark package namespace.
        Jetty version is taken from the pom file for Spark ${spark.version}
        -->
        <dependency>
            <groupId>org.eclipse.jetty</groupId>
            <artifactId>jetty-servlet</artifactId>
            <version>${jetty.version}</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest_2.11</artifactId>
            <scope>test</scope>
            <version>${scalatest.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.scala-lang</groupId>
                    <artifactId>scala-reflect</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

</project>
