<?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>rapids-4-spark-parent</artifactId>
    <groupId>com.nvidia</groupId>
    <version>0.4.0</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.nvidia</groupId>
  <artifactId>rapids-4-spark_2.12</artifactId>
  <name>RAPIDS Accelerator for Apache Spark Distribution</name>
  <version>0.4.0</version>
  <description>Creates the distribution package of the RAPIDS plugin for Apache Spark</description>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <filters>
                <filter>
                  <artifact>com.nvidia:rapids-4-spark_2.12</artifact>
                  <includes>
                    <include>META-INF/**</include>
                  </includes>
                  <excludes>
                    <exclude>META-INF/services/**</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <transformers>
            <transformer />
          </transformers>
          <shadedArtifactAttached>false</shadedArtifactAttached>
          <createDependencyReducedPom>true</createDependencyReducedPom>
          <relocations>
            <relocation>
              <pattern>org.apache.orc.</pattern>
              <shadedPattern>${rapids.shade.package}.orc.</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.apache.hadoop.hive.</pattern>
              <shadedPattern>${rapids.shade.package}.hadoop.hive.</shadedPattern>
              <excludes>
                <exclude>org.apache.hadoop.hive.conf.HiveConf</exclude>
                <exclude>org.apache.hadoop.hive.ql.exec.UDF</exclude>
                <exclude>org.apache.hadoop.hive.ql.udf.generic.GenericUDF</exclude>
              </excludes>
            </relocation>
            <relocation>
              <pattern>org.apache.hive.</pattern>
              <shadedPattern>${rapids.shade.package}.hive.</shadedPattern>
            </relocation>
            <relocation>
              <pattern>io.airlift.compress.</pattern>
              <shadedPattern>${rapids.shade.package}.io.airlift.compress.</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.apache.commons.codec.</pattern>
              <shadedPattern>${rapids.shade.package}.org.apache.commons.codec.</shadedPattern>
            </relocation>
            <relocation>
              <pattern>org.apache.commons.lang.</pattern>
              <shadedPattern>${rapids.shade.package}.org.apache.commons.lang.</shadedPattern>
            </relocation>
            <relocation>
              <pattern>com.google</pattern>
              <shadedPattern>${rapids.shade.package}.com.google</shadedPattern>
            </relocation>
          </relocations>
        </configuration>
      </plugin>
      <plugin>
        <groupId>net.alchim31.maven</groupId>
        <artifactId>scala-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>update_config</id>
            <phase>verify</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <launchers>
                <launcher>
                  <id>update_rapids_config</id>
                  <mainClass>com.nvidia.spark.rapids.RapidsConf</mainClass>
                  <args>
                    <arg>${project.basedir}/../docs/configs.md</arg>
                  </args>
                </launcher>
              </launchers>
            </configuration>
          </execution>
          <execution>
            <id>update_supported</id>
            <phase>verify</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <launchers>
                <launcher>
                  <id>update_rapids_support</id>
                  <mainClass>com.nvidia.spark.rapids.SupportedOpsDocs</mainClass>
                  <args>
                    <arg>${project.basedir}/../docs/supported_ops.md</arg>
                  </args>
                </launcher>
              </launchers>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <configuration>
          <excludes>
            <exclude>dependency-reduced-pom.xml</exclude>
            <exclude>*pom.xml.asc</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>pre-merge</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <executions>
              <execution>
                <id>if_modified_files</id>
                <phase>verify</phase>
                <goals>
                  <goal>exec</goal>
                </goals>
                <configuration>
                  <executable>bash</executable>
                  <commandlineArgs>-c 'export MODIFIED=$(git status --porcelain | grep "^ M"); [[ -z $MODIFIED ]] &amp;&amp; exit 0 || { echo -e "found modified files during mvn verify:\n$MODIFIED"; exit 1;}'</commandlineArgs>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-sql_2.12</artifactId>
      <version>3.0.0</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>univocity-parsers</artifactId>
          <groupId>com.univocity</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spark-sketch_2.12</artifactId>
          <groupId>org.apache.spark</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spark-core_2.12</artifactId>
          <groupId>org.apache.spark</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spark-catalyst_2.12</artifactId>
          <groupId>org.apache.spark</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spark-tags_2.12</artifactId>
          <groupId>org.apache.spark</groupId>
        </exclusion>
        <exclusion>
          <artifactId>parquet-column</artifactId>
          <groupId>org.apache.parquet</groupId>
        </exclusion>
        <exclusion>
          <artifactId>parquet-hadoop</artifactId>
          <groupId>org.apache.parquet</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jackson-databind</artifactId>
          <groupId>com.fasterxml.jackson.core</groupId>
        </exclusion>
        <exclusion>
          <artifactId>xbean-asm7-shaded</artifactId>
          <groupId>org.apache.xbean</groupId>
        </exclusion>
        <exclusion>
          <artifactId>unused</artifactId>
          <groupId>org.spark-project.spark</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.spark</groupId>
      <artifactId>spark-hive_2.12</artifactId>
      <version>3.0.0</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>hive-common</artifactId>
          <groupId>org.apache.hive</groupId>
        </exclusion>
        <exclusion>
          <artifactId>hive-exec</artifactId>
          <groupId>org.apache.hive</groupId>
        </exclusion>
        <exclusion>
          <artifactId>hive-metastore</artifactId>
          <groupId>org.apache.hive</groupId>
        </exclusion>
        <exclusion>
          <artifactId>hive-serde</artifactId>
          <groupId>org.apache.hive</groupId>
        </exclusion>
        <exclusion>
          <artifactId>hive-shims</artifactId>
          <groupId>org.apache.hive</groupId>
        </exclusion>
        <exclusion>
          <artifactId>hive-llap-common</artifactId>
          <groupId>org.apache.hive</groupId>
        </exclusion>
        <exclusion>
          <artifactId>hive-llap-client</artifactId>
          <groupId>org.apache.hive</groupId>
        </exclusion>
        <exclusion>
          <artifactId>avro</artifactId>
          <groupId>org.apache.avro</groupId>
        </exclusion>
        <exclusion>
          <artifactId>avro-mapred</artifactId>
          <groupId>org.apache.avro</groupId>
        </exclusion>
        <exclusion>
          <artifactId>commons-httpclient</artifactId>
          <groupId>commons-httpclient</groupId>
        </exclusion>
        <exclusion>
          <artifactId>httpclient</artifactId>
          <groupId>org.apache.httpcomponents</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jackson-mapper-asl</artifactId>
          <groupId>org.codehaus.jackson</groupId>
        </exclusion>
        <exclusion>
          <artifactId>joda-time</artifactId>
          <groupId>joda-time</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jodd-core</artifactId>
          <groupId>org.jodd</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jsr305</artifactId>
          <groupId>com.google.code.findbugs</groupId>
        </exclusion>
        <exclusion>
          <artifactId>datanucleus-core</artifactId>
          <groupId>org.datanucleus</groupId>
        </exclusion>
        <exclusion>
          <artifactId>libthrift</artifactId>
          <groupId>org.apache.thrift</groupId>
        </exclusion>
        <exclusion>
          <artifactId>libfb303</artifactId>
          <groupId>org.apache.thrift</groupId>
        </exclusion>
        <exclusion>
          <artifactId>derby</artifactId>
          <groupId>org.apache.derby</groupId>
        </exclusion>
        <exclusion>
          <artifactId>spark-core_2.12</artifactId>
          <groupId>org.apache.spark</groupId>
        </exclusion>
        <exclusion>
          <artifactId>unused</artifactId>
          <groupId>org.spark-project.spark</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
</project>
