<?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/maven-v4_0_0.xsd">
  <parent>
    <artifactId>zoo-parent</artifactId>
    <groupId>com.intel.analytics.zoo</groupId>
    <version>0.1.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>analytics-zoo-SPARK_2.2</artifactId>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>
  <build>
    <resources>
      <resource>
        <directory>${project.basedir}/src/main/resources</directory>
      </resource>
      <resource>
        <filtering>true</filtering>
        <directory>${project.build.directory}/extra-resources</directory>
      </resource>
    </resources>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>1.3.1</version>
          <executions>
            <execution>
              <id>enforce-versions</id>
              <goals>
                <goal>enforce</goal>
              </goals>
              <configuration>
                <rules>
                  <requireMavenVersion>
                    <version>3.0.4</version>
                  </requireMavenVersion>
                  <requireJavaVersion>
                    <version>${java.version}</version>
                  </requireJavaVersion>
                </rules>
              </configuration>
            </execution>
          </executions>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>generate-resources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <arguments>
                <argument>${project.basedir}/../scripts/zoo-build-info</argument>
                <argument>${project.build.directory}/extra-resources</argument>
                <argument>${project.version}</argument>
                <argument>${spark.version}</argument>
                <argument>${scala.version}</argument>
                <argument>${java.version}</argument>
              </arguments>
              <executable>bash</executable>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.scalatest</groupId>
        <artifactId>scalatest-maven-plugin</artifactId>
        <version>1.0</version>
        <executions>
          <execution>
            <id>test</id>
            <goals>
              <goal>test</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <reportsDirectory>${project.build.directory}/surefire-reports</reportsDirectory>
          <junitxml>.</junitxml>
          <filereports>bigdl-test-report.txt</filereports>
          <systemProperties>
            <bigdl.disableCheckSysEnv>true</bigdl.disableCheckSysEnv>
          </systemProperties>
          <argLine>-Xmx6g -XX:MaxPermSize=1g</argLine>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <id>shade</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <artifactSet>
                <includes>
                  <include>org.spark-project.spark:unused</include>
                </includes>
              </artifactSet>
            </configuration>
          </execution>
          <execution>
            <id>without-spark</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadedArtifactAttached>true</shadedArtifactAttached>
              <shadedClassifierName>jar-with-dependencies</shadedClassifierName>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <createDependencyReducedPom>true</createDependencyReducedPom>
          <shadedArtifactAttached>false</shadedArtifactAttached>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <executions>
          <execution>
            <id>with-spark</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <configuration>
              <descriptors>
                <descriptor>${project.basedir}/src/assembly/all-in-one.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
          <execution>
            <id>python</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <inherited>false</inherited>
            <configuration>
              <descriptors>
                <descriptor>${project.basedir}/src/assembly/python-zip.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
          <execution>
            <id>make-dist</id>
            <phase>package</phase>
            <goals>
              <goal>single</goal>
            </goals>
            <inherited>false</inherited>
            <configuration>
              <finalName>analytics-zoo-${project.version}-spark-${spark.version}</finalName>
              <descriptors>
                <descriptor>${project.basedir}/src/assembly/dist.xml</descriptor>
              </descriptors>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.scalastyle</groupId>
        <artifactId>scalastyle-maven-plugin</artifactId>
        <version>0.8.0</version>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <verbose>false</verbose>
          <failOnViolation>true</failOnViolation>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
          <failOnWarning>false</failOnWarning>
          <sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
          <testSourceDirectory>${basedir}/src/test/scala</testSourceDirectory>
          <configLocation>${project.basedir}/scalastyle_config.xml</configLocation>
          <outputFile>${project.build.directory}/stylecheck/scalastyle-output.xml</outputFile>
          <outputEncoding>UTF-8</outputEncoding>
        </configuration>
      </plugin>
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <id>eclipse-add-source</id>
            <goals>
              <goal>add-source</goal>
            </goals>
          </execution>
          <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>
            <configuration>
              <args>
                <arg>-skip-packages</arg>
                <arg>caffe:org.tensorflow:netty:org.apache.spark.sparkExtension:org.apache.spark.rdd:org.apache.spark.storage:org.apache.spark.bigdl</arg>
              </args>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <scalaVersion>${scala.version}</scalaVersion>
          <recompileMode>incremental</recompileMode>
          <useZincServer>false</useZincServer>
          <args>
            <arg>-unchecked</arg>
            <arg>-feature</arg>
          </args>
          <compilerPlugins>
            <compilerPlugin>
              <groupId>org.scalamacros</groupId>
              <artifactId>paradise_${scala.version}</artifactId>
              <version>${scala.macros.version}</version>
            </compilerPlugin>
          </compilerPlugins>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.7</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>false</autoReleaseAfterClose>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>spark_1.6</id>
      <properties>
        <spark-version.project>1.6-plus</spark-version.project>
        <scala.major.version>2.10</scala.major.version>
        <scala.macros.version>2.0.1</scala.macros.version>
        <scala.version>2.10.5</scala.version>
        <scalatest.version>2.2.4</scalatest.version>
        <bigdl.artifactId>bigdl-SPARK_1.6</bigdl.artifactId>
        <spark.version>1.6.3</spark.version>
      </properties>
    </profile>
    <profile>
      <id>spark_2.x</id>
      <properties>
        <spark-version.project>2.0</spark-version.project>
        <scala.major.version>2.11</scala.major.version>
        <scala.macros.version>2.1.0</scala.macros.version>
        <scala.version>2.11.8</scala.version>
        <javac.version>1.8</javac.version>
        <java.version>1.8</java.version>
        <bigdl.artifactId>bigdl-SPARK_2.1</bigdl.artifactId>
        <spark.version>2.0.0</spark.version>
      </properties>
    </profile>
    <profile>
      <id>without_bigdl</id>
      <properties>
        <bigdl-scope>provided</bigdl-scope>
      </properties>
    </profile>
    <profile>
      <id>scala_2.11</id>
      <properties>
        <scala.major.version>2.11</scala.major.version>
        <scala.macros.version>2.1.0</scala.macros.version>
        <scala.version>2.11.8</scala.version>
      </properties>
    </profile>
    <profile>
      <id>scala_2.10</id>
      <properties>
        <scala.major.version>2.10</scala.major.version>
        <scala.macros.version>2.0.1</scala.macros.version>
        <scala.version>2.10.5</scala.version>
      </properties>
    </profile>
    <profile>
      <id>all-in-one</id>
      <properties>
        <spark-scope>compile</spark-scope>
      </properties>
    </profile>
    <profile>
      <id>sign</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <repositories>
    <repository>
      <releases />
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>Maven Repository</name>
      <url>https://repo1.maven.org/maven2</url>
    </repository>
    <repository>
      <releases />
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>apache-repo</id>
      <name>Apache Repository</name>
      <url>https://repository.apache.org/content/repositories/releases</url>
    </repository>
    <repository>
      <releases />
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>jboss-repo</id>
      <name>JBoss Repository</name>
      <url>https://repository.jboss.org/nexus/content/repositories/releases</url>
    </repository>
    <repository>
      <releases />
      <snapshots />
      <id>sonatype</id>
      <name>sonatype repository</name>
      <url>https://oss.sonatype.org/content/groups/public/</url>
    </repository>
  </repositories>
  <dependencies>
    <dependency>
      <groupId>org.scalatest</groupId>
      <artifactId>scalatest_2.11</artifactId>
      <version>2.2.4</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>scala-xml_2.11</artifactId>
          <groupId>org.scala-lang.modules</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.reflections</groupId>
      <artifactId>reflections</artifactId>
      <version>0.9.9-RC1</version>
      <scope>test</scope>
      <exclusions>
        <exclusion>
          <artifactId>javassist</artifactId>
          <groupId>org.javassist</groupId>
        </exclusion>
        <exclusion>
          <artifactId>dom4j</artifactId>
          <groupId>dom4j</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-compiler</artifactId>
      <version>2.11.8</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>scala-parser-combinators_2.11</artifactId>
          <groupId>org.scala-lang.modules</groupId>
        </exclusion>
        <exclusion>
          <artifactId>scala-xml_2.11</artifactId>
          <groupId>org.scala-lang.modules</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-reflect</artifactId>
      <version>2.11.8</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-library</artifactId>
      <version>2.11.8</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-actors</artifactId>
      <version>2.11.8</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scalap</artifactId>
      <version>2.11.8</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-core_2.11</artifactId>
      <version>2.2.0</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>avro</artifactId>
          <groupId>org.apache.avro</groupId>
        </exclusion>
        <exclusion>
          <artifactId>avro-mapred</artifactId>
          <groupId>org.apache.avro</groupId>
        </exclusion>
        <exclusion>
          <artifactId>chill_2.11</artifactId>
          <groupId>com.twitter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>chill-java</artifactId>
          <groupId>com.twitter</groupId>
        </exclusion>
        <exclusion>
          <artifactId>xbean-asm5-shaded</artifactId>
          <groupId>org.apache.xbean</groupId>
        </exclusion>
        <exclusion>
          <artifactId>hadoop-client</artifactId>
          <groupId>org.apache.hadoop</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spark-launcher_2.11</artifactId>
          <groupId>org.apache.spark</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spark-network-common_2.11</artifactId>
          <groupId>org.apache.spark</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spark-network-shuffle_2.11</artifactId>
          <groupId>org.apache.spark</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spark-unsafe_2.11</artifactId>
          <groupId>org.apache.spark</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jets3t</artifactId>
          <groupId>net.java.dev.jets3t</groupId>
        </exclusion>
        <exclusion>
          <artifactId>curator-recipes</artifactId>
          <groupId>org.apache.curator</groupId>
        </exclusion>
        <exclusion>
          <artifactId>commons-math3</artifactId>
          <groupId>org.apache.commons</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jul-to-slf4j</artifactId>
          <groupId>org.slf4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jcl-over-slf4j</artifactId>
          <groupId>org.slf4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>slf4j-log4j12</artifactId>
          <groupId>org.slf4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>compress-lzf</artifactId>
          <groupId>com.ning</groupId>
        </exclusion>
        <exclusion>
          <artifactId>snappy-java</artifactId>
          <groupId>org.xerial.snappy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>lz4</artifactId>
          <groupId>net.jpountz.lz4</groupId>
        </exclusion>
        <exclusion>
          <artifactId>RoaringBitmap</artifactId>
          <groupId>org.roaringbitmap</groupId>
        </exclusion>
        <exclusion>
          <artifactId>commons-net</artifactId>
          <groupId>commons-net</groupId>
        </exclusion>
        <exclusion>
          <artifactId>json4s-jackson_2.11</artifactId>
          <groupId>org.json4s</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jersey-client</artifactId>
          <groupId>org.glassfish.jersey.core</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jersey-common</artifactId>
          <groupId>org.glassfish.jersey.core</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jersey-server</artifactId>
          <groupId>org.glassfish.jersey.core</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jersey-container-servlet</artifactId>
          <groupId>org.glassfish.jersey.containers</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jersey-container-servlet-core</artifactId>
          <groupId>org.glassfish.jersey.containers</groupId>
        </exclusion>
        <exclusion>
          <artifactId>netty-all</artifactId>
          <groupId>io.netty</groupId>
        </exclusion>
        <exclusion>
          <artifactId>netty</artifactId>
          <groupId>io.netty</groupId>
        </exclusion>
        <exclusion>
          <artifactId>stream</artifactId>
          <groupId>com.clearspring.analytics</groupId>
        </exclusion>
        <exclusion>
          <artifactId>metrics-core</artifactId>
          <groupId>io.dropwizard.metrics</groupId>
        </exclusion>
        <exclusion>
          <artifactId>metrics-jvm</artifactId>
          <groupId>io.dropwizard.metrics</groupId>
        </exclusion>
        <exclusion>
          <artifactId>metrics-json</artifactId>
          <groupId>io.dropwizard.metrics</groupId>
        </exclusion>
        <exclusion>
          <artifactId>metrics-graphite</artifactId>
          <groupId>io.dropwizard.metrics</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jackson-databind</artifactId>
          <groupId>com.fasterxml.jackson.core</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jackson-module-scala_2.11</artifactId>
          <groupId>com.fasterxml.jackson.module</groupId>
        </exclusion>
        <exclusion>
          <artifactId>ivy</artifactId>
          <groupId>org.apache.ivy</groupId>
        </exclusion>
        <exclusion>
          <artifactId>oro</artifactId>
          <groupId>oro</groupId>
        </exclusion>
        <exclusion>
          <artifactId>pyrolite</artifactId>
          <groupId>net.razorvine</groupId>
        </exclusion>
        <exclusion>
          <artifactId>py4j</artifactId>
          <groupId>net.sf.py4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spark-tags_2.11</artifactId>
          <groupId>org.apache.spark</groupId>
        </exclusion>
        <exclusion>
          <artifactId>commons-crypto</artifactId>
          <groupId>org.apache.commons</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-mllib_2.11</artifactId>
      <version>2.2.0</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>spark-streaming_2.11</artifactId>
          <groupId>org.apache.spark</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spark-sql_2.11</artifactId>
          <groupId>org.apache.spark</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spark-graphx_2.11</artifactId>
          <groupId>org.apache.spark</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spark-mllib-local_2.11</artifactId>
          <groupId>org.apache.spark</groupId>
        </exclusion>
        <exclusion>
          <artifactId>pmml-model</artifactId>
          <groupId>org.jpmml</groupId>
        </exclusion>
        <exclusion>
          <artifactId>commons-math3</artifactId>
          <groupId>org.apache.commons</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spark-tags_2.11</artifactId>
          <groupId>org.apache.spark</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.intel.analytics.bigdl</groupId>
      <artifactId>bigdl-SPARK_2.2</artifactId>
      <version>0.5.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>org.tensorflow</groupId>
      <artifactId>tensorflow</artifactId>
      <version>1.8.0</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <scalatest.version>2.2.4</scalatest.version>
    <java.version>1.7</java.version>
    <spark-scope>provided</spark-scope>
    <bigdl-scope>compile</bigdl-scope>
    <bigdl.version>0.5.0</bigdl.version>
    <maven-enforcer-plugin.version>1.3.1</maven-enforcer-plugin.version>
    <javac.version>1.7</javac.version>
    <scala.version>2.11.8</scala.version>
    <scala.major.version>2.11</scala.major.version>
    <scala.macros.version>2.1.0</scala.macros.version>
    <spark.version>2.1.0</spark.version>
  </properties>
</project>

