<?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">
    <parent>
        <artifactId>presto-root</artifactId>
        <groupId>io.hetu.core</groupId>
        <version>1.4.0</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>hetu-opengauss</artifactId>
    <description>Hetu - OpenGauss Connector</description>
    <packaging>hetu-plugin</packaging>

    <properties>
        <air.main.basedir>${project.parent.basedir}</air.main.basedir>
        <version.maven-surefire-plugin>3.0.0-M2</version.maven-surefire-plugin>
    </properties>

    <repositories>
        <repository>
            <id>lk-thirdparty</id>
            <name>openLooKeng thirdparty maven</name>
            <url>https://download.openlookeng.io/thirdparty-maven/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-base-jdbc</artifactId>
        </dependency>

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

        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>

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

        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>

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

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

        <!-- Presto SPI -->
        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-spi</artifactId>
            <scope>provided</scope>
        </dependency>

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

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>units</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>

        <!-- for testing -->
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>

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

        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-main</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>log4j-over-slf4j</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.sun</groupId>
                    <artifactId>tools</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcprov-jdk15on</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>io.hetu.core</groupId>
            <artifactId>presto-tests</artifactId>
            <scope>test</scope>
        </dependency>

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

        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-postgresql</artifactId>
            <version>1.4.0</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.postgresql</groupId>
                    <artifactId>postgresql</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

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

        <dependency>
            <groupId>io.hetu.core</groupId>
            <artifactId>presto-postgresql</artifactId>
            <version>1.4.0</version>
            <classifier>tests</classifier>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.postgresql</groupId>
                    <artifactId>postgresql</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>testing-postgresql-server</artifactId>
            <scope>test</scope>
        </dependency>

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

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <id>unpack</id>
                        <phase>package</phase>
                        <configuration>
                            <target>
                                <echo message="unjar" />
                                <unzip src="${project.build.directory}/${project.artifactId}-${project.version}/presto-postgresql-${project.version}.jar" dest="${project.build.directory}/unpacked/" />
                                <echo message="delete spi file" />
                                <delete dir="${project.build.directory}/unpacked/META-INF/services" />
                                <echo message="Redo jar" />
                                <jar destfile="${project.build.directory}/${project.artifactId}-${project.version}/presto-postgresql-${project.version}.jar" basedir="${project.build.directory}/unpacked" />
                                <zip basedir="${project.build.directory}/${project.artifactId}-${project.version}" destfile="${project.build.directory}/${project.artifactId}-${project.version}.zip" />
                            </target>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>