<?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.14.0</version>
    <relativePath>../../../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>hudi-flink1.14-bundle</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>
                <transformer />
              </transformers>
              <artifactSet>
                <includes>
                  <include>org.apache.hudi:hudi-common</include>
                  <include>org.apache.hudi:hudi-client-common</include>
                  <include>org.apache.hudi:hudi-flink-client</include>
                  <include>org.apache.hudi:hudi-flink</include>
                  <include>org.apache.hudi:${hudi.flink.module}</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.esotericsoftware:kryo-shaded</include>
                  <include>com.esotericsoftware:minlog</include>
                  <include>org.objenesis:objenesis</include>
                  <include>com.yammer.metrics:metrics-core</include>
                  <include>com.beust:jcommander</include>
                  <include>io.javalin:javalin</include>
                  <include>org.jetbrains.kotlin:*</include>
                  <include>org.rocksdb:rocksdbjni</include>
                  <include>org.antlr:stringtemplate</include>
                  <include>org.apache.parquet:parquet-avro</include>
                  <include>org.apache.parquet:parquet-hadoop</include>
                  <include>org.apache.parquet:parquet-column</include>
                  <include>org.apache.parquet:parquet-common</include>
                  <include>org.apache.parquet:parquet-format-structures</include>
                  <include>org.apache.parquet:parquet-encoding</include>
                  <include>org.apache.parquet:parquet-jackson</include>
                  <include>org.apache.avro:avro</include>
                  <include>joda-time:joda-time</include>
                  <include>com.fasterxml.jackson.core:jackson-annotations</include>
                  <include>com.fasterxml.jackson.core:jackson-core</include>
                  <include>com.fasterxml.jackson.core:jackson-databind</include>
                  <include>com.fasterxml.jackson.datatype:jackson-datatype-jsr310</include>
                  <include>com.lmax:disruptor</include>
                  <include>com.github.davidmoten:guava-mini</include>
                  <include>com.github.davidmoten:hilbert-curve</include>
                  <include>com.github.ben-manes.caffeine:caffeine</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>org.eclipse.jetty:*</include>
                  <include>org.eclipse.jetty.websocket:*</include>
                  <include>javax.servlet:javax.servlet-api</include>
                  <include>org.apache.flink:${flink.hadoop.compatibility.artifactId}</include>
                  <include>org.apache.flink:flink-json</include>
                  <include>org.apache.flink:${flink.parquet.artifactId}</include>
                  <include>org.apache.flink:flink-metrics-dropwizard</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-exec</include>
                  <include>org.apache.hive:hive-standalone-metastore</include>
                  <include>org.apache.hive:hive-metastore</include>
                  <include>org.apache.hive:hive-jdbc</include>
                  <include>org.datanucleus:datanucleus-core</include>
                  <include>org.datanucleus:datanucleus-api-jdo</include>
                  <include>org.apache.thrift:libfb303</include>
                  <include>org.apache.orc:orc-core</include>
                  <include>commons-codec:commons-codec</include>
                  <include>commons-io:commons-io</include>
                  <include>org.openjdk.jol:jol-core</include>
                </includes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>com.esotericsoftware.kryo.</pattern>
                  <shadedPattern>org.apache.hudi.com.esotericsoftware.kryo.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.esotericsoftware.reflectasm.</pattern>
                  <shadedPattern>org.apache.hudi.com.esotericsoftware.reflectasm.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.esotericsoftware.minlog.</pattern>
                  <shadedPattern>org.apache.hudi.com.esotericsoftware.minlog.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.objenesis.</pattern>
                  <shadedPattern>org.apache.hudi.org.objenesis.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>javax.servlet.</pattern>
                  <shadedPattern>${flink.bundle.shade.prefix}javax.servlet.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.avro.</pattern>
                  <shadedPattern>${flink.bundle.shade.prefix}org.apache.avro.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.commons.io.</pattern>
                  <shadedPattern>org.apache.hudi.org.apache.commons.io.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.yammer.metrics.</pattern>
                  <shadedPattern>${flink.bundle.shade.prefix}com.yammer.metrics.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.beust.jcommander.</pattern>
                  <shadedPattern>${flink.bundle.shade.prefix}com.beust.jcommander.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.codahale.metrics.</pattern>
                  <shadedPattern>${flink.bundle.shade.prefix}com.codahale.metrics.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.commons.codec.</pattern>
                  <shadedPattern>${flink.bundle.shade.prefix}org.apache.commons.codec.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.eclipse.jetty.</pattern>
                  <shadedPattern>${flink.bundle.shade.prefix}org.apache.jetty.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.fasterxml.jackson.</pattern>
                  <shadedPattern>${flink.bundle.shade.prefix}com.fasterxml.jackson.</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.openjdk.jol.</pattern>
                  <shadedPattern>org.apache.hudi.org.openjdk.jol.</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>
                    <exclude>**/*.proto</exclude>
                    <exclude>hbase-webapps/**</exclude>
                    <exclude>hbase-default.xml</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>flink-bundle-shade-hive1</id>
      <properties>
        <thrift.version>0.9.2</thrift.version>
        <flink.bundle.hive.scope>compile</flink.bundle.hive.scope>
        <hive.version>1.1.0</hive.version>
      </properties>
    </profile>
    <profile>
      <id>flink-bundle-shade-hive2</id>
      <dependencies>
        <dependency>
          <groupId>${hive.groupid}</groupId>
          <artifactId>hive-service-rpc</artifactId>
          <version>${hive.version}</version>
          <scope>${flink.bundle.hive.scope}</scope>
        </dependency>
      </dependencies>
      <properties>
        <flink.bundle.hive.scope>compile</flink.bundle.hive.scope>
        <hive.version>2.3.1</hive.version>
      </properties>
    </profile>
    <profile>
      <id>flink-bundle-shade-hive3</id>
      <dependencies>
        <dependency>
          <groupId>${hive.groupid}</groupId>
          <artifactId>hive-service-rpc</artifactId>
          <version>${hive.version}</version>
          <scope>${flink.bundle.hive.scope}</scope>
        </dependency>
        <dependency>
          <groupId>${hive.groupid}</groupId>
          <artifactId>hive-standalone-metastore</artifactId>
          <version>${hive.version}</version>
          <scope>${flink.bundle.hive.scope}</scope>
        </dependency>
      </dependencies>
      <properties>
        <flink.bundle.hive.scope>compile</flink.bundle.hive.scope>
        <hive.version>3.1.2</hive.version>
      </properties>
    </profile>
    <profile>
      <id>hudi-platform-service</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-shade-plugin</artifactId>
            <version>${maven-shade-plugin.version}</version>
            <executions>
              <execution>
                <configuration>
                  <artifactSet>
                    <includes>
                      <include>org.apache.hudi:hudi-metaserver-client</include>
                    </includes>
                  </artifactSet>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
      <dependencies>
        <dependency>
          <groupId>org.apache.hudi</groupId>
          <artifactId>hudi-metaserver-client</artifactId>
          <version>0.14.0</version>
          <scope>compile</scope>
        </dependency>
      </dependencies>
    </profile>
  </profiles>
  <dependencies>
    <dependency>
      <groupId>org.apache.hive</groupId>
      <artifactId>hive-service</artifactId>
      <version>2.3.1</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>guava</artifactId>
          <groupId>com.google.guava</groupId>
        </exclusion>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>org.eclipse.jetty</groupId>
        </exclusion>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>org.pentaho</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.hive</groupId>
      <artifactId>hive-exec</artifactId>
      <version>2.3.1</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>org.pentaho</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>*</artifactId>
          <groupId>javax.servlet</groupId>
        </exclusion>
        <exclusion>
          <artifactId>datanucleus-core</artifactId>
          <groupId>org.datanucleus</groupId>
        </exclusion>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>javax.servlet.jsp</groupId>
        </exclusion>
        <exclusion>
          <artifactId>guava</artifactId>
          <groupId>com.google.guava</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>*</artifactId>
          <groupId>javax.servlet</groupId>
        </exclusion>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>javax.servlet.jsp</groupId>
        </exclusion>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>org.eclipse.jetty</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>javax.servlet</artifactId>
          <groupId>org.eclipse.jetty.orbit</groupId>
        </exclusion>
        <exclusion>
          <artifactId>*</artifactId>
          <groupId>org.eclipse.jetty</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.datanucleus</groupId>
      <artifactId>datanucleus-core</artifactId>
      <version>5.0.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.datanucleus</groupId>
      <artifactId>datanucleus-api-jdo</artifactId>
      <version>5.0.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.thrift</groupId>
      <artifactId>libfb303</artifactId>
      <version>0.9.3</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.orc</groupId>
      <artifactId>orc-core</artifactId>
      <version>1.5.6</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <properties>
    <javax.servlet.version>3.1.0</javax.servlet.version>
    <hive.version>2.3.1</hive.version>
    <main.basedir>${project.parent.basedir}</main.basedir>
    <flink.bundle.shade.prefix>org.apache.hudi.</flink.bundle.shade.prefix>
    <thrift.version>0.9.3</thrift.version>
    <flink.bundle.hive.scope>provided</flink.bundle.hive.scope>
    <parquet.version>${flink.format.parquet.version}</parquet.version>
    <skipTests>true</skipTests>
    <checkstyle.skip>true</checkstyle.skip>
  </properties>
</project>
