<!--

    The Alluxio Open Foundation licenses this work under the Apache License, version 2.0
    (the "License"). You may not use this work except in compliance with the License, which is
    available at www.apache.org/licenses/LICENSE-2.0

    This software is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
    either express or implied, as more fully set forth in the License.

    See the NOTICE file distributed with this work for information regarding copyright ownership.

-->
<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>
  <parent>
    <groupId>org.alluxio</groupId>
    <artifactId>alluxio-integration</artifactId>
    <version>2.2.0</version>
  </parent>
  <artifactId>alluxio-checker</artifactId>
  <name>Alluxio Integration - Checker</name>
  <description>Check integration of computation frameworks with Alluxio</description>

  <properties>
    <!-- These need to be defined here as well as in the parent pom so that mvn can run
         properly from sub-project directories -->
    <build.path>${project.parent.parent.basedir}/build</build.path>
    <checker.hadoop.version>${hadoop.version}</checker.hadoop.version>
  </properties>

  <dependencies>
    <!-- External dependencies -->
    <dependency>
      <groupId>com.beust</groupId>
      <artifactId>jcommander</artifactId>
    </dependency>

    <!-- We pick a particular Hadoop version here for convenience, but this checker
         should work in general for Hadoop 2.x -->
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-client</artifactId>
      <version>${checker.hadoop.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.hadoop</groupId>
      <artifactId>hadoop-yarn-client</artifactId>
      <version>${checker.hadoop.version}</version>
    </dependency>

    <!-- We pick a particular Hive version here for convenience, but this checker
         should work in general for Hive 2.x -->
    <dependency>
      <groupId>org.apache.hive</groupId>
      <artifactId>hive-jdbc</artifactId>
      <version>2.3.2</version>
      <exclusions>
        <exclusion>
          <groupId>org.jamon</groupId>
          <artifactId>jamon-runtime</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

    <!-- We pick a particular Spark version here for convenience, but this checker
         should work in general for Spark 2.x -->
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-core_2.11</artifactId>
      <version>2.2.1</version>
    </dependency>

    <!-- Internal dependencies -->
    <dependency>
      <groupId>org.alluxio</groupId>
      <artifactId>alluxio-core-common</artifactId>
      <version>${project.version}</version>
      <!-- We mark alluxio-core-common as provided to prevent the integration checker
           Assembly jar to include Alluxio classes-->
      <scope>provided</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <id>uber-jar</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <finalName>${project.artifactId}-${project.version}-jar-with-dependencies</finalName>
              <filters>
                <filter>
                  <artifact>*:* </artifact>
                  <excludes>
                    <exclude>LICENSE</exclude>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
              <transformers>
                <transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer" />
              </transformers>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>java11</id>
      <activation>
        <jdk>11</jdk>
      </activation>
      <dependencies>
        <dependency>
          <groupId>org.apache.hadoop</groupId>
          <artifactId>hadoop-yarn-client</artifactId>
          <version>${checker.hadoop.version}</version>
          <exclusions>
              <exclusion>
                <groupId>jdk.tools</groupId>
                <artifactId>jdk.tools</artifactId>
              </exclusion>
          </exclusions>
        </dependency>
        <dependency>
          <groupId>org.apache.hive</groupId>
          <artifactId>hive-jdbc</artifactId>
          <version>2.3.2</version>
          <exclusions>
            <exclusion>
              <groupId>org.jamon</groupId>
              <artifactId>jamon-runtime</artifactId>
            </exclusion>
            <exclusion>
              <groupId>jdk.tools</groupId>
              <artifactId>jdk.tools</artifactId>
            </exclusion>
          </exclusions>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
</project>
