<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at
      http://www.apache.org/licenses/LICENSE-2.0
  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <parent>
    <groupId>org.apache.hive</groupId>
    <artifactId>hive</artifactId>
    <version>4.0.0-alpha-1</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <artifactId>hive-iceberg</artifactId>
  <version>4.0.0-alpha-1</version>
  <packaging>pom</packaging>
  <name>Hive Iceberg Modules</name>
  <properties>
    <hive.path.to.root>..</hive.path.to.root>
    <path.to.iceberg.root>.</path.to.iceberg.root>
    <iceberg.version>0.13.1</iceberg.version>
    <kryo-shaded.version>4.0.2</kryo-shaded.version>
    <iceberg.mockito-core.version>3.4.4</iceberg.mockito-core.version>
    <iceberg.avro.version>1.9.2</iceberg.avro.version>
    <iceberg.kryo.version>4.0.2</iceberg.kryo.version>
    <iceberg.checkstyle.plugin.version>3.1.2</iceberg.checkstyle.plugin.version>
    <spotless.maven.plugin.version>2.5.0</spotless.maven.plugin.version>
    <google.errorprone.javac.version>9+181-r4173-1</google.errorprone.javac.version>
    <google.errorprone.version>2.5.1</google.errorprone.version>
    <assertj.version>3.19.0</assertj.version>
    <junit.jupiter.version>5.7.2</junit.jupiter.version>
    <validate.skip>false</validate.skip>
  </properties>
  <modules>
    <module>patched-iceberg-api</module>
    <module>patched-iceberg-core</module>
    <module>iceberg-shading</module>
    <module>iceberg-catalog</module>
    <module>iceberg-handler</module>
  </modules>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.iceberg</groupId>
        <artifactId>patched-iceberg-api</artifactId>
        <version>patched-${iceberg.version}-${project.parent.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.iceberg</groupId>
        <artifactId>patched-iceberg-core</artifactId>
        <version>patched-${iceberg.version}-${project.parent.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.iceberg</groupId>
        <artifactId>iceberg-api</artifactId>
        <version>${iceberg.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.iceberg</groupId>
        <artifactId>iceberg-core</artifactId>
        <version>${iceberg.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.iceberg</groupId>
        <artifactId>iceberg-hive-metastore</artifactId>
        <version>${iceberg.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.iceberg</groupId>
        <artifactId>iceberg-data</artifactId>
        <version>${iceberg.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.iceberg</groupId>
        <artifactId>iceberg-parquet</artifactId>
        <version>${iceberg.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.iceberg</groupId>
        <artifactId>iceberg-orc</artifactId>
        <version>${iceberg.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.hive</groupId>
        <artifactId>hive-iceberg-catalog</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.hive</groupId>
        <artifactId>hive-iceberg-shading</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.hive</groupId>
        <artifactId>hive-exec</artifactId>
        <version>${project.version}</version>
        <exclusions>
          <exclusion>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
          </exclusion>
          <exclusion>
            <groupId>com.google.guava</groupId>
            <artifactId>*</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.avro</groupId>
            <artifactId>avro</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.hive</groupId>
            <artifactId>hive-llap-tez</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>*</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.pentaho</groupId>
            <artifactId>*</artifactId>
          </exclusion>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.hive</groupId>
        <artifactId>hive-serde</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.hive</groupId>
        <artifactId>hive-standalone-metastore-common</artifactId>
        <version>${standalone-metastore.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-client</artifactId>
        <version>${hadoop.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.apache.avro</groupId>
            <artifactId>avro</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.avro</groupId>
        <artifactId>avro</artifactId>
        <version>${iceberg.avro.version}</version>
      </dependency>
      <!-- test dependencies -->
      <dependency>
        <groupId>org.apache.hive</groupId>
        <artifactId>hive-service</artifactId>
        <version>${project.version}</version>
        <exclusions>
          <exclusion>
            <groupId>org.apache.hive</groupId>
            <artifactId>hive-exec</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.hive</groupId>
        <artifactId>hive-standalone-metastore-server</artifactId>
        <classifier>tests</classifier>
        <version>${standalone-metastore.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.hive</groupId>
        <artifactId>hive-iceberg-catalog</artifactId>
        <classifier>tests</classifier>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-core</artifactId>
        <version>${assertj.version}</version>
      </dependency>
      <dependency>
        <groupId>org.junit.jupiter</groupId>
        <artifactId>junit-jupiter-api</artifactId>
        <version>${junit.jupiter.version}</version>
      </dependency>
      <dependency>
        <groupId>com.esotericsoftware</groupId>
        <artifactId>kryo-shaded</artifactId>
        <version>${kryo-shaded.version}</version>
      </dependency>
      <dependency>
        <groupId>org.mockito</groupId>
        <artifactId>mockito-inline</artifactId>
        <version>${iceberg.mockito-core.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless.maven.plugin.version}</version>
        <configuration>
          <skip>${validate.skip}</skip>
          <java>
            <removeUnusedImports/>
            <importOrder>
              <!-- normal imports, static imports -->
              <order>,\# </order>
            </importOrder>
            <trimTrailingWhitespace/>
            <endWithNewline/>
            <indent>
              <spaces>true</spaces>
              <spacesPerTab>2</spacesPerTab>
            </indent>
          </java>
        </configuration>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${iceberg.checkstyle.plugin.version}</version>
        <configuration>
          <skip>${validate.skip}</skip>
          <propertyExpansion>config_loc=${basedir}/${path.to.iceberg.root}/checkstyle/</propertyExpansion>
          <configLocation>${basedir}/${path.to.iceberg.root}/checkstyle/checkstyle.xml</configLocation>
          <suppressionsLocation>${basedir}/${path.to.iceberg.root}/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
          <encoding>UTF-8</encoding>
          <consoleOutput>true</consoleOutput>
          <failsOnError>true</failsOnError>
        </configuration>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>errorProne</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <fork>true</fork>
              <showWarnings>true</showWarnings>
              <compilerArgs>
                <arg>-XDcompilePolicy=simple</arg>
                <arg>-Xplugin:ErrorProne -Xep:BanSerializableRead:WARN</arg>
                <arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${google.errorprone.javac.version}/javac-${google.errorprone.javac.version}.jar</arg>
              </compilerArgs>
              <annotationProcessorPaths>
                <path>
                  <groupId>com.google.errorprone</groupId>
                  <artifactId>error_prone_core</artifactId>
                  <version>${google.errorprone.version}</version>
                </path>
              </annotationProcessorPaths>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
