<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.etsy.sahale</groupId>
  <artifactId>flowtracker-pom_2.12</artifactId>
  <packaging>pom</packaging>
  <version>2.0.1</version>

  <name>flowtracker-pom</name>
  <description>A Cascading Workflow Visualizer</description>
  <url>https://github.com/etsy/Sahale</url>

  <modules>
      <module>flowtracker</module>
      <module>flowtracker-gcp</module>
  </modules>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.basedir>.</project.basedir>
    <scala.version>2.12.4</scala.version>
    <scala.shortversion>2.12</scala.shortversion>
    <hadoop.version>2.7.0</hadoop.version>
    <cascading.version>2.6.1</cascading.version>
  </properties>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://opensource.org/licenses/MIT</url>
      <distribution>repo</distribution>
    </license>
  </licenses>


  <scm>
    <url>git@github.com:etsy/Sahale.git</url>
    <connection>scm:git:git@github.com:etsy/Sahale.git</connection>
  </scm>

  <developers>
    <developer>
      <id>initialcontext</id>
      <name>Eli Reisman</name>
      <url>github.com/initialcontext</url>
    </developer>
    <developer>
      <id>ajsquared</id>
      <name>Andrew Johnson</name>
      <url>github.com/ajsquared</url>
    </developer>
  </developers>

  <repositories>
    <repository>
      <id>sonatype-oss</id>
      <url>http://oss.sonatype.org/content/repositories/releases/</url>
    </repository>

    <repository>
      <id>conjars.org</id>
      <url>http://conjars.org/repo</url>
    </repository>
  </repositories>

  <pluginRepositories>
    <pluginRepository>
      <id>sonatype-oss</id>
      <url>http://oss.sonatype.org/content/repositories/releases/</url>
    </pluginRepository>
  </pluginRepositories>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <build>
    <resources>
      <resource>
        <directory>${project.basedir}/src/main/resources</directory>
        <filtering>true</filtering>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>${project.basedir}/src/test/resources</directory>
      </testResource>
    </testResources>
    <pluginManagement>
      <plugins>
        <!-- Raise the default heap and thread stack sizes because scalac is a piece of crap -->
        <plugin>
          <groupId>net.alchim31.maven</groupId>
          <artifactId>scala-maven-plugin</artifactId>
          <version>3.2.1</version>
          <executions>
            <execution>
              <goals>
                <goal>compile</goal>
                <goal>testCompile</goal>
              </goals>
            </execution>
            <execution>
              <id>generate-javadoc-jar</id>
              <phase>package</phase>
              <goals>
                <goal>doc-jar</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
          </configuration>
        </plugin>

        <!-- disable surefire -->
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>2.7</version>
          <configuration>
            <skipTests>true</skipTests>
          </configuration>
        </plugin>
        <!-- enable scalatest -->
        <plugin>
          <groupId>org.scalatest</groupId>
          <artifactId>scalatest-maven-plugin</artifactId>
          <version>1.0-RC2</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.apache.maven.plugins</groupId>
          <artifactId>maven-source-plugin</artifactId>
          <version>2.4</version>
          <executions>
            <execution>
              <id>attach-sources</id>
              <goals>
                <goal>jar-no-fork</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.10.3</version>
          <executions>
            <execution>
              <id>attach-javadocs</id>
              <goals>
                <goal>jar</goal>
              </goals>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.etsy.sahale</groupId>
        <artifactId>flowtracker_${scala.shortversion}</artifactId>
        <version>${project.version}</version>
      </dependency>
    <dependency>
      <groupId>com.google.api-client</groupId>
      <artifactId>google-api-client</artifactId>
      <version>1.20.0</version> <!-- set to version used in GCS connector -->
      <scope>provided</scope> <!-- should also be marked as provided in downstream deps -->
    </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <!-- hadoop-client is a nice single-import for CDH distributions.
         If you use vanilla Apache Hadoop distribution on your cluster,
         you might need to add additional dependency tags for packages like
         hadoop-common, hadoop-hdfs, and hadoop-mapreduce. See your individual
         Hadoop distro documentation for details.
    -->
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-client</artifactId>
      <version>${hadoop.version}</version>
    </dependency>

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

    <dependency>
      <groupId>io.spray</groupId>
      <artifactId>spray-json_2.12</artifactId>
      <version>1.3.2</version>
      <exclusions>
        <exclusion>
          <groupId>org.scala-lang</groupId>
          <artifactId>scala-library</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.16</version>
    </dependency>

    <dependency>
      <groupId>cascading</groupId>
      <artifactId>cascading-core</artifactId>
      <version>${cascading.version}</version>
    </dependency>

    <dependency>
      <groupId>commons-httpclient</groupId>
      <artifactId>commons-httpclient</artifactId>
      <version>3.0.1</version>
    </dependency>

    <dependency>
      <groupId>com.twitter</groupId>
      <artifactId>scalding-core_2.12</artifactId>
      <version>0.17.4</version>
      <exclusions>
        <exclusion>
          <groupId>org.scala-lang</groupId>
          <artifactId>scala-library</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.10</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.scalatest</groupId>
      <artifactId>scalatest_2.12</artifactId>
      <version>3.0.3</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <groupId>org.scala-lang</groupId>
          <artifactId>scala-library</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>

  <profiles>
    <profile>
      <id>release</id>
      <build>
        <plugins>
          <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>
            <configuration>
              <useAgent>true</useAgent>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.4</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar-no-fork</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.10.3</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </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>
        </plugins>
      </build>
    </profile>
  </profiles>

</project>
