<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright 2025 Qiheng He
  ~
  ~ 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="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>
    <groupId>io.github.linghengqian</groupId>
    <artifactId>hive-parent</artifactId>
    <version>1.8.2</version>

    <packaging>pom</packaging>
    <name>${project.groupId}:${project.artifactId}</name>
    <description>Third-party builds of HiveServer2 JDBC Driver</description>
    <url>https://github.com/linghengqian/hive-server2-jdbc-driver</url>
    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>
    <developers>
        <developer>
            <name>Qiheng He</name>
            <email>linghengqian@outlook.com</email>
            <organizationUrl>https://github.com/linghengqian</organizationUrl>
        </developer>
    </developers>
    <scm>
        <connection>scm:git:git://github.com/linghengqian/hive-server2-jdbc-driver.git</connection>
        <developerConnection>scm:git:ssh://github.com:linghengqian/hive-server2-jdbc-driver.git</developerConnection>
        <url>https://github.com/linghengqian/hive-server2-jdbc-driver/tree/master</url>
    </scm>

    <properties>
        <maven.compiler.release>8</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <apache-hive-jdbc.version>4.0.1</apache-hive-jdbc.version>
        <parquet.version>1.13.1</parquet.version>
        <hadoop.version>3.3.6</hadoop.version>
        <httpcomponents.client.version>4.5.13</httpcomponents.client.version>
        <httpcomponents.core.version>4.4.13</httpcomponents.core.version>
        <libthrift.version>0.16.0</libthrift.version>
        <zookeeper.version>3.8.3</zookeeper.version>
        <curator.version>5.2.0</curator.version>
        <commons-codec.version>1.15</commons-codec.version>
        <guava.version>22.0</guava.version>
        <commons-text.version>1.10.0</commons-text.version>
        <slf4j.version>1.7.30</slf4j.version>

        <!-- Dependencies come from `hive-storage-api` under `apache/hive` -->
        <commons-logging.version>1.1.3</commons-logging.version>

        <!-- Dependencies come from `apache/hadoop` -->
        <stax2-api.version>4.2.1</stax2-api.version>

        <junit-bom.version>5.13.4</junit-bom.version>
        <testcontainers-bom.version>1.21.3</testcontainers-bom.version>
        <hikaricp.version>4.0.3</hikaricp.version>
        <awaitility.version>4.3.0</awaitility.version>

        <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
        <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
        <central-publishing-maven-plugin.version>0.8.0</central-publishing-maven-plugin.version>
        <native-maven-plugin.version>0.11.0</native-maven-plugin.version>
        <maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
    </properties>

    <modules>
        <module>thin</module>
        <module>uber</module>
        <module>reachability-metadata</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit-bom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers-bom</artifactId>
                <version>${testcontainers-bom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpcore</artifactId>
                <version>${httpcomponents.core.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.zookeeper</groupId>
                <artifactId>zookeeper</artifactId>
                <version>${zookeeper.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.thrift</groupId>
                <artifactId>libthrift</artifactId>
                <version>${libthrift.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-codec</groupId>
                <artifactId>commons-codec</artifactId>
                <version>${commons-codec.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>${commons-logging.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-text</artifactId>
                <version>${commons-text.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.codehaus.woodstox</groupId>
                <artifactId>stax2-api</artifactId>
                <version>${stax2-api.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <version>${awaitility.version}</version>
            <scope>test</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
            <version>${hikaricp.version}</version>
            <scope>test</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-nop</artifactId>
            <version>${slf4j.version}</version>
            <scope>test</scope>
            <optional>true</optional>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <compilerArgs>
                            <arg>-Xlint:-options</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>publishing-via-the-central-portal</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven-source-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>${maven-javadoc-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${maven-gpg-plugin.version}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>${central-publishing-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>nativeTestInCustom</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.graalvm.buildtools</groupId>
                        <artifactId>native-maven-plugin</artifactId>
                        <version>${native-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <quickBuild>true</quickBuild>
                            <buildArgs>
                                <buildArg>-H:+UnlockExperimentalVMOptions</buildArg>
                                <buildArg>-H:ThrowMissingRegistrationErrors=</buildArg>
                                <buildArg>-H:MissingRegistrationReportingMode=Warn</buildArg>
                            </buildArgs>
                        </configuration>
                        <executions>
                            <execution>
                                <id>test-native</id>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <phase>test</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>nativeTestInJava23+</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.graalvm.buildtools</groupId>
                        <artifactId>native-maven-plugin</artifactId>
                        <version>${native-maven-plugin.version}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <quickBuild>true</quickBuild>
                            <buildArgs>
                                <buildArg>-H:+UnlockExperimentalVMOptions</buildArg>
                                <buildArg>--exact-reachability-metadata</buildArg>
                            </buildArgs>
                            <runtimeArgs>
                                <runtimeArg>-XX:MissingRegistrationReportingMode=Warn</runtimeArg>
                            </runtimeArgs>
                        </configuration>
                        <executions>
                            <execution>
                                <id>test-native</id>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <phase>test</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
