<?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>oss-parent</artifactId>
    <groupId>org.sonatype.oss</groupId>
    <version>7</version>
    <relativePath>../../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>io.trino.hive</groupId>
  <artifactId>hive-apache</artifactId>
  <name>hive-apache</name>
  <version>3.1.2-16</version>
  <description>Shaded version of Apache Hive for Trino</description>
  <url>https://github.com/trinodb/trino-hive-apache</url>
  <inceptionYear>2013</inceptionYear>
  <licenses>
    <license>
      <name>Apache License 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <scm>
    <connection>scm:git:git://github.com/trinodb/trino-hive-apache.git</connection>
    <developerConnection>scm:git:git://github.com/trinodb/trino-hive-apache.git</developerConnection>
    <tag>3.1.2-16</tag>
    <url>https://github.com/trinodb/trino-hive-apache</url>
  </scm>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-release-plugin</artifactId>
          <version>2.5</version>
          <configuration>
            <mavenExecutorId>forked-path</mavenExecutorId>
            <pushChanges>false</pushChanges>
            <localCheckout>true</localCheckout>
            <useReleaseProfile>false</useReleaseProfile>
            <preparationGoals>clean install</preparationGoals>
            <autoVersionSubmodules>true</autoVersionSubmodules>
            <tagNameFormat>@{project.version}</tagNameFormat>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>1.4</version>
          <configuration>
            <useAgent>true</useAgent>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>2.9</version>
          <configuration>
            <source>${project.build.targetJdk}</source>
            <additionalparam>-quiet</additionalparam>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>exec</goal>
            </goals>
            <configuration>
              <executable>${basedir}/bin/generate-sources.sh</executable>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>build-helper-maven-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <phase>generate-sources</phase>
            <goals>
              <goal>add-source</goal>
            </goals>
            <configuration>
              <sources>
                <source>${project.build.directory}/generated-sources/thrift/</source>
              </sources>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>1.2</version>
        <executions>
          <execution>
            <goals>
              <goal>enforce</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <rules>
            <requireJavaVersion>
              <version>${project.build.targetJdk}</version>
            </requireJavaVersion>
          </rules>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
          <source>${project.build.targetJdk}</source>
          <target>${project.build.targetJdk}</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.12.4</version>
      </plugin>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.3</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <createSourcesJar>true</createSourcesJar>
              <shadeSourcesContent>true</shadeSourcesContent>
              <dependencyReducedPomLocation>${project.build.directory}/pom.xml</dependencyReducedPomLocation>
              <promoteTransitiveDependencies>true</promoteTransitiveDependencies>
              <artifactSet>
                <excludes>
                  <exclude>joda-time:joda-time</exclude>
                  <exclude>org.apache.thrift:libthrift</exclude>
                  <exclude>io.airlift:aircompressor</exclude>
                  <exclude>com.github.luben:zstd-jni</exclude>
                </excludes>
              </artifactSet>
              <relocations>
                <relocation>
                  <pattern>com.google.protobuf</pattern>
                  <shadedPattern>${shadeBase}.com.google.protobuf</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.apache.commons</pattern>
                  <shadedPattern>${shadeBase}.org.apache.commons</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.facebook.fb303</pattern>
                  <shadedPattern>${shadeBase}.com.facebook.fb303</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.google.common</pattern>
                  <shadedPattern>${shadeBase}.com.google.common</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.google.thirdparty</pattern>
                  <shadedPattern>${shadeBase}.com.google.thirdparty</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.objectweb.asm</pattern>
                  <shadedPattern>${shadeBase}.org.objectweb.asm</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.objenesis</pattern>
                  <shadedPattern>${shadeBase}.org.objenesis</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.codehaus.jackson</pattern>
                  <shadedPattern>${shadeBase}.org.codehaus.jackson</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.fasterxml.jackson</pattern>
                  <shadedPattern>${shadeBase}.com.fasterxml.jackson</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.json</pattern>
                  <shadedPattern>${shadeBase}.org.json</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>au.com.bytecode.opencsv</pattern>
                  <shadedPattern>${shadeBase}.au.com.bytecode.opencsv</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>com.codahale.metrics</pattern>
                  <shadedPattern>${shadeBase}.com.codahale.metrics</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>shaded.parquet</pattern>
                  <shadedPattern>${shadeBase}.parquet</shadedPattern>
                </relocation>
                <relocation>
                  <pattern>org.slf4j</pattern>
                  <shadedPattern>${shadeBase}.org.slf4j</shadedPattern>
                </relocation>
              </relocations>
              <filters>
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>META-INF/maven/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.slf4j:*</artifact>
                  <excludes>
                    <exclude>META-INF/services/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.apache.hive:hive-common</artifact>
                  <excludes>
                    <exclude>hive-log4j2.properties</exclude>
                    <exclude>parquet-logging.properties</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.apache.hive:hive-exec</artifact>
                  <excludes>
                    <exclude>META-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat</exclude>
                    <exclude>hive-exec-log4j2.properties</exclude>
                    <exclude>tez-container-log4j2.properties</exclude>
                    <exclude>org/apache/hadoop/hive/ql/io/avro/AvroGenericRecordReader.class</exclude>
                    <exclude>org/apache/hadoop/hive/ql/io/avro/AvroGenericRecordReader$*.class</exclude>
                    <exclude>org/apache/hadoop/hive/ql/io/CodecPool.class</exclude>
                    <exclude>org/apache/hadoop/hive/ql/io/CodecPool$*.class</exclude>
                    <exclude>org/apache/hadoop/hive/ql/io/parquet/timestamp/NanoTimeUtils.class</exclude>
                    <exclude>org/apache/hadoop/hive/ql/io/parquet/timestamp/NanoTimeUtils$*.class</exclude>
                    <exclude>org/apache/tez/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.apache.hive:hive-standalone-metastore</artifact>
                  <excludes>
                    <exclude>package.jdo</exclude>
                    <exclude>org/apache/hadoop/hive/metastore/api/**</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.apache.hive:hive-serde</artifact>
                  <excludes>
                    <exclude>org/apache/hadoop/hive/serde2/avro/AvroDeserializer.class</exclude>
                    <exclude>org/apache/hadoop/hive/serde2/avro/AvroDeserializer$*.class</exclude>
                    <exclude>org/apache/hadoop/hive/serde2/avro/InstanceCache.class</exclude>
                    <exclude>org/apache/hadoop/hive/serde2/avro/InstanceCache$*.class</exclude>
                    <exclude>org/apache/hadoop/hive/serde2/avro/SchemaToTypeInfo.class</exclude>
                    <exclude>org/apache/hadoop/hive/serde2/avro/SchemaToTypeInfo$*.class</exclude>
                    <exclude>org/apache/hadoop/hive/serde2/avro/TypeInfoToSchema.class</exclude>
                    <exclude>org/apache/hadoop/hive/serde2/avro/TypeInfoToSchema$*.class</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.apache.hive.hcatalog:hive-hcatalog-core</artifact>
                  <excludes>
                    <exclude>org/apache/hive/hcatalog/data/JsonSerDe.class</exclude>
                    <exclude>org/apache/hive/hcatalog/data/JsonSerDe$*.class</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.apache.avro:avro</artifact>
                  <excludes>
                    <exclude>overview.html</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.apache.parquet:parquet-avro</artifact>
                  <excludes>
                    <exclude>stringBehavior.avsc</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>org.apache.commons:commons-lang3</artifact>
                  <excludes>
                    <exclude>templates/release-notes.vm</exclude>
                  </excludes>
                </filter>
                <filter>
                  <artifact>com.fasterxml.jackson.core:*</artifact>
                  <excludes>
                    <exclude>META-INF/services/**</exclude>
                  </excludes>
                </filter>
              </filters>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>io.airlift</groupId>
      <artifactId>aircompressor</artifactId>
      <version>0.10</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>slice</artifactId>
          <groupId>io.airlift</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.thrift</groupId>
      <artifactId>libthrift</artifactId>
      <version>0.9.3</version>
      <scope>compile</scope>
      <exclusions>
        <exclusion>
          <artifactId>httpclient</artifactId>
          <groupId>org.apache.httpcomponents</groupId>
        </exclusion>
        <exclusion>
          <artifactId>httpcore</artifactId>
          <groupId>org.apache.httpcomponents</groupId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>joda-time</groupId>
      <artifactId>joda-time</artifactId>
      <version>2.9.9</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.github.luben</groupId>
      <artifactId>zstd-jni</artifactId>
      <version>1.4.9-1</version>
      <scope>compile</scope>
    </dependency>
  </dependencies>
  <properties>
    <dep.hive.version>3.1.2</dep.hive.version>
    <dep.protobuf.version>2.5.0</dep.protobuf.version>
    <shadeBase>io.trino.hive.\$internal</shadeBase>
    <dep.avro.version>1.10.2</dep.avro.version>
    <project.build.targetJdk>1.8</project.build.targetJdk>
    <dep.parquet.version>1.12.1</dep.parquet.version>
    <dep.slf4j.version>1.7.29</dep.slf4j.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <dep.hadoop.version>3.1.4</dep.hadoop.version>
  </properties>
</project>

