<?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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <artifactId>presto-root</artifactId>
        <groupId>io.hetu.core</groupId>
        <version>1.9.0</version>
    </parent>

    <artifactId>hetu-iceberg</artifactId>
    <description>hetu - Iceberg Connector</description>
    <packaging>hetu-plugin</packaging>


    <properties>
        <air.main.basedir>${project.parent.basedir}</air.main.basedir>
        <dep.iceberg.version>0.13.1</dep.iceberg.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.google.http-client</groupId>
            <artifactId>google-http-client</artifactId>
            <version>1.25.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.iceberg</groupId>
            <artifactId>iceberg-bundled-guava</artifactId>
            <version>0.13.1</version>
        </dependency>
        <dependency>
            <groupId>com.google.errorprone</groupId>
            <artifactId>error_prone_annotations</artifactId>
            <version>2.3.2</version>
        </dependency>
        <dependency>
            <groupId>org.checkerframework</groupId>
            <artifactId>checker-qual</artifactId>
            <version>2.5.2</version>
        </dependency>
        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>testing</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>aopalliance</groupId>
            <artifactId>aopalliance</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>aircompressor</artifactId>
        </dependency>
        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>concurrent</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>units</artifactId>
                    <groupId>io.airlift</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>hetu-common</artifactId>
        </dependency>
        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-tests</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.roaringbitmap</groupId>
                    <artifactId>RoaringBitmap</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>units</artifactId>
                    <groupId>io.airlift</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-main</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>aircompressor</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>hetu-common</artifactId>
                    <groupId>io.hetu.core</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>plexus-cipher</artifactId>
                    <groupId>org.sonatype.plexus</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>plexus-classworlds</artifactId>
                    <groupId>org.codehaus.plexus</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>units</artifactId>
                    <groupId>io.airlift</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-hive</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <!-- calcite-core and iceberg-data have conflicting versions of org.apache.commons:commons-lang3 -->
                    <groupId>com.linkedin.calcite</groupId>
                    <artifactId>calcite-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>aircompressor</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.google.errorprone</groupId>
                    <artifactId>error_prone_annotations</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>hetu-common</artifactId>
                    <groupId>io.hetu.core</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>units</artifactId>
                    <groupId>io.airlift</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-memory-context</artifactId>
            <exclusions>
                <exclusion>
                    <artifactId>units</artifactId>
                    <groupId>io.airlift</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-orc</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>aircompressor</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>hetu-common</artifactId>
                    <groupId>io.hetu.core</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>units</artifactId>
                    <groupId>io.airlift</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-parquet</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>aircompressor</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>units</artifactId>
                    <groupId>io.airlift</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-plugin-toolkit</artifactId>
            <version>${project.version}</version>
            <exclusions>
                <exclusion>
                    <artifactId>units</artifactId>
                    <groupId>io.airlift</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.prestosql.hadoop</groupId>
            <artifactId>hadoop-apache</artifactId>
            <version>${dep.prestosql.apache.hadoop.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>io.hetu.core</groupId>
                    <artifactId>hetu-hazelcast</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.prestosql.cassandra</groupId>
                    <artifactId>cassandra-driver</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>io.prestosql.hive</groupId>
            <artifactId>hive-apache</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>aircompressor</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>units</artifactId>
                    <groupId>io.airlift</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>bootstrap</artifactId>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>configuration</artifactId>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>event</artifactId>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>json</artifactId>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>log</artifactId>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>units</artifactId>
            <version>1.6</version>
        </dependency>

        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-core</artifactId>
        </dependency>

        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-glue</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>

        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.google.errorprone</groupId>
                    <artifactId>error_prone_annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.checkerframework</groupId>
                    <artifactId>checker-qual</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>animal-sniffer-annotations</artifactId>
                    <groupId>org.codehaus.mojo</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
        </dependency>

        <dependency>
            <groupId>javax.inject</groupId>
            <artifactId>javax.inject</artifactId>
        </dependency>

        <dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
        </dependency>

        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
        </dependency>

        <dependency>
            <groupId>net.jodah</groupId>
            <artifactId>failsafe</artifactId>
        </dependency>

        <!-- Iceberg -->
        <dependency>
            <groupId>org.apache.iceberg</groupId>
            <artifactId>iceberg-api</artifactId>
            <version>${dep.iceberg.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.iceberg</groupId>
            <artifactId>iceberg-core</artifactId>
            <version>${dep.iceberg.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.avro</groupId>
                    <artifactId>avro</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.roaringbitmap</groupId>
                    <artifactId>RoaringBitmap</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.google.errorprone</groupId>
                    <artifactId>error_prone_annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.github.ben-manes.caffeine</groupId>
                    <artifactId>caffeine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.github.ben-manes.caffeine</groupId>
            <artifactId>caffeine</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>com.google.errorprone</groupId>
                    <artifactId>error_prone_annotations</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>checker-qual</artifactId>
                    <groupId>org.checkerframework</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.iceberg</groupId>
            <artifactId>iceberg-data</artifactId>
            <version>${dep.iceberg.version}</version>
            <exclusions>
                <!-- The parquet-avro dependency uses a different version of org.apache.thrift:libthrift -->
                <exclusion>
                    <groupId>org.apache.parquet</groupId>
                    <artifactId>parquet-avro</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>aircompressor</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.jetbrains</groupId>
                    <artifactId>annotations</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>orc-core</artifactId>
                    <groupId>org.apache.orc</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.iceberg</groupId>
            <artifactId>iceberg-hive-metastore</artifactId>
            <version>${dep.iceberg.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.github.ben-manes.caffeine</groupId>
                    <artifactId>caffeine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.apache.iceberg</groupId>
            <artifactId>iceberg-parquet</artifactId>
            <version>${dep.iceberg.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.parquet</groupId>
                    <artifactId>parquet-avro</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>units</artifactId>
                    <groupId>io.airlift</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.weakref</groupId>
            <artifactId>jmxutils</artifactId>
        </dependency>

        <!-- used by tests but also needed transitively -->
        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>log-manager</artifactId>
            <scope>runtime</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>units</artifactId>
                    <groupId>io.airlift</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>stats</artifactId>
            <scope>runtime</scope>
            <exclusions>
                <exclusion>
                    <artifactId>units</artifactId>
                    <groupId>io.airlift</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-java-sdk-s3</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.iceberg</groupId>
            <artifactId>iceberg-orc</artifactId>
            <version>${dep.iceberg.version}</version>
            <scope>runtime</scope>
            <exclusions>
                <exclusion>
                    <!-- This version of the Avro dependency fails Maven Enforcer RequireUpperBoundDeps checks -->
                    <groupId>org.apache.avro</groupId>
                    <artifactId>avro</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>orc-core</artifactId>
                    <groupId>org.apache.orc</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-spi</artifactId>
            <version>${project.version}</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <artifactId>units</artifactId>
                    <groupId>io.airlift</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>slice</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.openjdk.jol</groupId>
            <artifactId>jol-core</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-main</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <artifactId>units</artifactId>
                    <groupId>io.airlift</groupId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-hive</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.linkedin.calcite</groupId>
                    <artifactId>calcite-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-tpch</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.airlift.tpch</groupId>
            <artifactId>tpch</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>hetu-mongodb</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <artifactId>hamcrest-core</artifactId>
                    <groupId>org.hamcrest</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-base-jdbc</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <artifactId>units</artifactId>
                    <groupId>io.airlift</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>hetu-vdm</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <configuration>
                    <rules>
                        <requireUpperBoundDeps>
                            <excludes combine.children="append">
                                <exclude>com.google.guava:guava</exclude>
                            </excludes>
                        </requireUpperBoundDeps>
                    </rules>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.basepom.maven</groupId>
                <artifactId>duplicate-finder-maven-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                    <ignoredResourcePatterns>
                        <!-- com.amazonaws:aws-java-sdk-core and software.amazon.awssdk:sdk-core MIME type file duplicate-->
                        <ignoredResourcePattern>mime.types</ignoredResourcePattern>
                        <ignoredResourcePattern>about.html</ignoredResourcePattern>
                    </ignoredResourcePatterns>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludes>
                                <exclude>**/TestIceberg*FailureRecoveryTest.java</exclude>
                                <exclude>**/TestIcebergGlueCatalogConnectorSmokeTest.java</exclude>
                                <exclude>**/TestTrinoGlueCatalogTest.java</exclude>
                                <exclude>**/TestSharedGlueMetastore.java</exclude>
                                <exclude>**/TestIcebergGlueCatalogAccessOperations.java</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>test-failure-recovery</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <!-- Failure recovery tests spend most of the time waiting for a retry -->
                            <threadCount>4</threadCount>
                            <includes>
                                <include>**/TestIceberg*FailureRecoveryTest.java</include>
                            </includes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>test-glue-catalog</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <includes>
                                <include>**/TestIcebergGlueCatalogConnectorSmokeTest.java</include>
                                <include>**/TestTrinoGlueCatalogTest.java</include>
                                <include>**/TestSharedGlueMetastore.java</include>
                                <include>**/TestIcebergGlueCatalogAccessOperations.java</include>
                            </includes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
