<?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>hudi</artifactId>
    <groupId>org.apache.hudi</groupId>
    <version>0.10.0</version>
    <relativePath>../../../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>hudi-spark-bundle_2.11</artifactId>
  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>src/test/resources</directory>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>${maven-shade-plugin.version}</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createSourcesJar>${shadeSources}</createSourcesJar>
              <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
              <transformers>
                <transformer />
                <transformer>
                  <addHeader>true</addHeader>
                </transformer>
                <transformer>
                  <resource>META-INF/LICENSE</resource>
                  <file>target/classes/META-INF/LICENSE</file>
                </transformer>
              </transformers>
              <artifactSet>
                <includes>
                  <include>org.apache.hudi:hudi-common</include>
                  <include>org.apache.hudi:hudi-client-common</include>
                  <include>org.apache.hudi:hudi-spark-client</include>
                  <include>org.apache.hudi:hudi-spark-common_${scala.binary.version}</include>
                  <include>org.apache.hudi:hudi-spark_${scala.binary.version}</include>
                  <include>org.apache.hudi:${hudi.spark.module}_${scala.binary.version}</include>
                  <include>org.apache.hudi:hudi-hive-sync</include>
                  <include>org.apache.hudi:hudi-sync-common</include>
                  <include>org.apache.hudi:hudi-hadoop-mr</include>
                  <include>org.apache.hudi:hudi-timeline-service</include>
                  <include>org.apache.hudi:hudi-aws</include>
                  <include>com.beust:jcommander</include>
                  <include>io.javalin:javalin</include>
                  <include>org.eclipse.jetty:*</include>
                  <include>org.eclipse.jetty.websocket:*</include>
                  <include>org.jetbrains.kotlin:*</include>
                  <include>org.rocksdb:rocksdbjni</include>
                  <include>org.apache.httpcomponents:httpclient</include>
                  <include>org.apache.httpcomponents:httpcore</include>
                  <include>org.apache.httpcomponents:fluent-hc</include>
                  <include>org.antlr:stringtemplate</include>
                  <include>org.apache.parquet:parquet-avro</include>
                  <include>com.github.davidmoten:guava-mini</include>
                  <include>com.github.davidmoten:hilbert-curve</include>
                  <include>com.twitter:bijection-avro_${scala.binary.version}</include>
                  <include>com.twitter:bijection-core_${scala.binary.version}</include>
                  <include>io.dropwizard.metrics:metrics-core</include>
                  <include>io.dropwizard.metrics:metrics-graphite</include>
                  <include>io.dropwizard.metrics:metrics-jmx</include>
                  <include>io.prometheus:simpleclient</include>
                  <include>io.prometheus:simpleclient_httpserver</include>
                  <include>io.prometheus:simpleclient_dropwizard</include>
                  <include>io.prometheus:simpleclient_pushgateway</include>
                  <include>io.prometheus:simpleclient_common</include>
                  <include>com.yammer.metrics:metrics-core</include>
                  <include>com.google.guava:guava</include>
                  <include>com.amazonaws:dynamodb-lock-client</include>
                  <include>com.amazonaws:aws-java-sdk-dynamodb</include>
                  <include>com.amazonaws:aws-java-sdk-core</include>
                  <include>org.apache.spark:spark-avro_${scala.binary.version}</include>
                  <include>org.apache.hive:hive-common</include>
                  <include>org.apache.hive:hive-service</include>
                  <include>org.apache.hive:hive-service-rpc</include>
                  <include>org.apache.hive:hive-metastore</include>
                  <include>org.apache.hive:hive-jdbc</include>
                  <include>org.apache.hbase:hbase-client</include>
                  <include>org.apache.hbase:hbase-common</include>
                  <include>org.apache.hbase:hbase-protocol</include>
                  <include>org.apache.hbase:hbase-server</include>
                  <include>org.apache.htrace:htrace-core</include>
                  <include>org.apache.curator:curator-framework</include>
                  <include>org.apache.curator:curator-client</include>
                  <include>org.apache.curator:curator-recipes</include>
                  <include>commons-codec:commons-codec</include>
                </includes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>com.yammer.metrics.</pattern>
                  <shadedPattern>org.apache.hudi.com.yammer.metrics.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.beust.jcommander.</pattern>
                  <shadedPattern>org.apache.hudi.com.beust.jcommander.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.spark.sql.avro.</pattern>
                  <shadedPattern>${spark.bundle.spark.shade.prefix}org.apache.spark.sql.avro.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.hive.jdbc.</pattern>
                  <shadedPattern>${spark.bundle.hive.shade.prefix}org.apache.hive.jdbc.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.hadoop.hive.metastore.</pattern>
                  <shadedPattern>${spark.bundle.hive.shade.prefix}org.apache.hadoop.hive.metastore.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.hive.common.</pattern>
                  <shadedPattern>${spark.bundle.hive.shade.prefix}org.apache.hive.common.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.hadoop.hive.common.</pattern>
                  <shadedPattern>${spark.bundle.hive.shade.prefix}org.apache.hadoop.hive.common.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.hadoop.hive.conf.</pattern>
                  <shadedPattern>${spark.bundle.hive.shade.prefix}org.apache.hadoop.hive.conf.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.hive.service.</pattern>
                  <shadedPattern>${spark.bundle.hive.shade.prefix}org.apache.hive.service.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.hadoop.hive.service.</pattern>
                  <shadedPattern>${spark.bundle.hive.shade.prefix}org.apache.hadoop.hive.service.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.codahale.metrics.</pattern>
                  <shadedPattern>org.apache.hudi.com.codahale.metrics.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.commons.codec.</pattern>
                  <shadedPattern>org.apache.hudi.org.apache.commons.codec.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.eclipse.jetty.</pattern>
                  <shadedPattern>org.apache.hudi.org.apache.jetty.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.google.common.</pattern>
                  <shadedPattern>${spark.bundle.spark.shade.prefix}com.google.common.</shadedPattern>
                </relocation>
              </relocations>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                    <exclude>META-INF/services/javax.*</exclude>
                  </excludes>
                </filter>
              </filters>
              <finalName>${project.artifactId}-${project.version}</finalName>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>spark-bundle-shade-hive</id>
      <properties>
        <spark.bundle.hive.scope>compile</spark.bundle.hive.scope>
        <spark.bundle.hive.shade.prefix>org.apache.hudi.</spark.bundle.hive.shade.prefix>
      </properties>
    </profile>
    <profile>
      <id>spark-shade-unbundle-avro</id>
      <properties>
        <spark.bundle.avro.scope>provided</spark.bundle.avro.scope>
      </properties>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.apache.hive</groupId>
      <artifactId>hive-service</artifactId>
      <version>2.3.1</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>javax.mail</groupId>
        </exclusion>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>org.eclipse.jetty.aggregate</groupId>
        </exclusion>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>org.pentaho</groupId>
        </exclusion>
        <exclusion>
          <artifactId>hive-exec</artifactId>
          <groupId>org.apache.hive</groupId>
        </exclusion>
        <exclusion>
          <artifactId>hive-llap-server</artifactId>
          <groupId>org.apache.hive</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jpam</artifactId>
          <groupId>net.sf.jpam</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jasper-compiler</artifactId>
          <groupId>tomcat</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jasper-runtime</artifactId>
          <groupId>tomcat</groupId>
        </exclusion>
        <exclusion>
          <artifactId>libfb303</artifactId>
          <groupId>org.apache.thrift</groupId>
        </exclusion>
        <exclusion>
          <artifactId>libthrift</artifactId>
          <groupId>org.apache.thrift</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.hive</groupId>
      <artifactId>hive-service-rpc</artifactId>
      <version>2.3.1</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>jasper-compiler</artifactId>
          <groupId>tomcat</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jasper-runtime</artifactId>
          <groupId>tomcat</groupId>
        </exclusion>
        <exclusion>
          <artifactId>libfb303</artifactId>
          <groupId>org.apache.thrift</groupId>
        </exclusion>
        <exclusion>
          <artifactId>libthrift</artifactId>
          <groupId>org.apache.thrift</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.hive</groupId>
      <artifactId>hive-jdbc</artifactId>
      <version>2.3.1</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>mail</artifactId>
          <groupId>javax.mail</groupId>
        </exclusion>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>org.eclipse.jetty.aggregate</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>libthrift</artifactId>
          <groupId>org.apache.thrift</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.hive</groupId>
      <artifactId>hive-metastore</artifactId>
      <version>2.3.1</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>jta</artifactId>
          <groupId>javax.transaction</groupId>
        </exclusion>
        <exclusion>
          <artifactId>transaction-api</artifactId>
          <groupId>javax.transaction</groupId>
        </exclusion>
        <exclusion>
          <artifactId>mail</artifactId>
          <groupId>javax.mail</groupId>
        </exclusion>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>org.eclipse.jetty.aggregate</groupId>
        </exclusion>
        <exclusion>
          <artifactId>javolution</artifactId>
          <groupId>javolution</groupId>
        </exclusion>
        <exclusion>
          <artifactId>bonecp</artifactId>
          <groupId>com.jolbox</groupId>
        </exclusion>
        <exclusion>
          <artifactId>HikariCP</artifactId>
          <groupId>com.zaxxer</groupId>
        </exclusion>
        <exclusion>
          <artifactId>derby</artifactId>
          <groupId>org.apache.derby</groupId>
        </exclusion>
        <exclusion>
          <artifactId>datanucleus-api-jdo</artifactId>
          <groupId>org.datanucleus</groupId>
        </exclusion>
        <exclusion>
          <artifactId>datanucleus-core</artifactId>
          <groupId>org.datanucleus</groupId>
        </exclusion>
        <exclusion>
          <artifactId>datanucleus-rdbms</artifactId>
          <groupId>org.datanucleus</groupId>
        </exclusion>
        <exclusion>
          <artifactId>commons-dbcp</artifactId>
          <groupId>commons-dbcp</groupId>
        </exclusion>
        <exclusion>
          <artifactId>jdo-api</artifactId>
          <groupId>javax.jdo</groupId>
        </exclusion>
        <exclusion>
          <artifactId>javax.jdo</artifactId>
          <groupId>org.datanucleus</groupId>
        </exclusion>
        <exclusion>
          <artifactId>antlr-runtime</artifactId>
          <groupId>org.antlr</groupId>
        </exclusion>
        <exclusion>
          <artifactId>tephra-api</artifactId>
          <groupId>co.cask.tephra</groupId>
        </exclusion>
        <exclusion>
          <artifactId>tephra-core</artifactId>
          <groupId>co.cask.tephra</groupId>
        </exclusion>
        <exclusion>
          <artifactId>tephra-hbase-compat-1.0</artifactId>
          <groupId>co.cask.tephra</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>libfb303</artifactId>
          <groupId>org.apache.thrift</groupId>
        </exclusion>
        <exclusion>
          <artifactId>libthrift</artifactId>
          <groupId>org.apache.thrift</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.hive</groupId>
      <artifactId>hive-common</artifactId>
      <version>2.3.1</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>mail</artifactId>
          <groupId>javax.mail</groupId>
        </exclusion>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>org.eclipse.jetty.aggregate</groupId>
        </exclusion>
        <exclusion>
          <artifactId>commons-lang3</artifactId>
          <groupId>org.apache.commons</groupId>
        </exclusion>
        <exclusion>
          <artifactId>javax.servlet</artifactId>
          <groupId>org.eclipse.jetty.orbit</groupId>
        </exclusion>
        <exclusion>
          <artifactId>log4j-1.2-api</artifactId>
          <groupId>org.apache.logging.log4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>log4j-web</artifactId>
          <groupId>org.apache.logging.log4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>log4j-slf4j-impl</artifactId>
          <groupId>org.apache.logging.log4j</groupId>
        </exclusion>
        <exclusion>
          <artifactId>commons-compress</artifactId>
          <groupId>org.apache.commons</groupId>
        </exclusion>
        <exclusion>
          <artifactId>ant</artifactId>
          <groupId>org.apache.ant</groupId>
        </exclusion>
        <exclusion>
          <artifactId>json</artifactId>
          <groupId>com.tdunning</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>dropwizard-metrics-hadoop-metrics2-reporter</artifactId>
          <groupId>com.github.joshelser</groupId>
        </exclusion>
        <exclusion>
          <artifactId>hive-shims</artifactId>
          <groupId>org.apache.hive</groupId>
        </exclusion>
      </exclusions>
    </dependency>
  </dependencies>
  <properties>
    <main.basedir>${project.parent.basedir}</main.basedir>
    <checkstyle.skip>true</checkstyle.skip>
  </properties>
</project>
