<?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>
        <groupId>io.trino</groupId>
        <artifactId>trino-root</artifactId>
        <version>399-h0.cbu.mrs.330.r37</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>trino-jdbc</artifactId>
    <name>trino-jdbc</name>

    <properties>
        <air.main.basedir>${project.parent.basedir}</air.main.basedir>
        <project.build.targetJdk>8</project.build.targetJdk>
        <shadeBase>io.trino.jdbc.\$internal</shadeBase>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.trino</groupId>
            <artifactId>hetu-common</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>log</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>security</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>commons-io</groupId>
                    <artifactId>commons-io</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.projectlombok</groupId>
                    <artifactId>lombok</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.mikesamuel</groupId>
                    <artifactId>json-sanitizer</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.trino</groupId>
            <artifactId>hetu-high-availability</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>io.dropwizard.metrics</groupId>
                    <artifactId>metrics-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>configuration</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>concurrent</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>discovery</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>log</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.google.inject</groupId>
                    <artifactId>guice</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>ch.qos.reload4j</groupId>
                    <artifactId>reload4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.trino</groupId>
            <artifactId>hetu-hsbroker-client</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>log</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.bouncycastle</groupId>
                    <artifactId>bcprov-jdk15on</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.trino</groupId>
            <artifactId>trino-client</artifactId>
        </dependency>

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

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>units</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>org.checkerframework</groupId>
                    <artifactId>checker-qual</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.google.errorprone</groupId>
                    <artifactId>error_prone_annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.google.j2objc</groupId>
                    <artifactId>j2objc-annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>animal-sniffer-annotations</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.huawei.us</groupId>
            <artifactId>us-common</artifactId>
        </dependency>

        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
        </dependency>

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

        <dependency>
            <groupId>org.apache.zookeeper</groupId>
            <artifactId>zookeeper</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.yetus</groupId>
                    <artifactId>audience-annotations</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15on</artifactId>
        </dependency>

        <!-- for testing -->
        <dependency>
            <groupId>io.trino</groupId>
            <artifactId>trino-blackhole</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>log</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.trino</groupId>
            <artifactId>trino-hive-hadoop2</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>log</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.linkedin.calcite</groupId>
                    <artifactId>calcite-core</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.trino</groupId>
            <artifactId>trino-main</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>log</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.commons</groupId>
                    <artifactId>commons-lang3</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.teradata</groupId>
                    <artifactId>re2j-td</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.trino</groupId>
            <artifactId>trino-memory</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>log</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.trino</groupId>
            <artifactId>trino-parser</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.trino</groupId>
            <artifactId>trino-password-authenticators</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>log</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.trino</groupId>
            <artifactId>trino-spi</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.trino</groupId>
            <artifactId>trino-testing</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>log</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.teradata</groupId>
                    <artifactId>re2j-td</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.trino</groupId>
            <artifactId>trino-tpch</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>concurrent</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>log</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

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

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>jaxrs</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>log</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

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

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>log-manager</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>io.airlift</groupId>
                    <artifactId>log</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

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

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

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

        <dependency>
            <groupId>com.oracle.ojdbc</groupId>
            <artifactId>ojdbc8</artifactId>
            <version>${dep.oracle.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>mockwebserver</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-api</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-impl</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-jackson</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <scope>test</scope>
        </dependency>

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

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

        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>oracle-xe</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>postgresql</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.projectlombok</groupId>
                    <artifactId>lombok</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>io/trino/jdbc/driver.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>io/trino/jdbc/driver.properties</exclude>
                </excludes>
            </resource>
        </resources>

        <pluginManagement>
            <plugins>
                <!-- TODO: move this to Airbase -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <configuration>
                        <propertiesEncoding>ISO-8859-1</propertiesEncoding>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createSourcesJar>true</createSourcesJar>
                            <shadeSourcesContent>true</shadeSourcesContent>
                            <dependencyReducedPomLocation>${project.build.directory}/pom.xml</dependencyReducedPomLocation>
                            <relocations>
                                <relocation>
                                    <pattern>io.trino.client</pattern>
                                    <shadedPattern>${shadeBase}.client</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.fasterxml.jackson</pattern>
                                    <shadedPattern>${shadeBase}.jackson</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.google.common</pattern>
                                    <shadedPattern>${shadeBase}.guava</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.google.thirdparty</pattern>
                                    <shadedPattern>${shadeBase}.guava</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>io.airlift</pattern>
                                    <shadedPattern>${shadeBase}.airlift</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.annotation</pattern>
                                    <shadedPattern>${shadeBase}.javax.annotation</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>javax.inject</pattern>
                                    <shadedPattern>${shadeBase}.javax.inject</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.joda.time</pattern>
                                    <shadedPattern>${shadeBase}.joda.time</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>okhttp3</pattern>
                                    <shadedPattern>${shadeBase}.okhttp3</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>okio</pattern>
                                    <shadedPattern>${shadeBase}.okio</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>net.jodah.failsafe</pattern>
                                    <shadedPattern>${shadeBase}.net.jodah.failsafe</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.apache</pattern>
                                    <shadedPattern>${shadeBase}.org.apache</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.weakref.jmx</pattern>
                                    <shadedPattern>${shadeBase}.org.weakref.jmx</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>com.huawei</pattern>
                                    <shadedPattern>${shadeBase}.com.huawei</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>org.bouncycastle</pattern>
                                    <shadedPattern>${shadeBase}.org.bouncycastle</shadedPattern>
                                </relocation>
                            </relocations>
                            <filters>
                                <filter>
                                    <artifact>io.airlift:units</artifact>
                                    <excludes>
                                        <exclude>ValidationMessages.properties</exclude>
                                    </excludes>
                                </filter>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/maven/**</exclude>
                                        <exclude>META-INF/services/com.fasterxml.**</exclude>
                                        <exclude>META-INF/proguard/okhttp3.pro</exclude>
                                        <exclude>LICENSE</exclude>
                                    </excludes>
                                </filter>
                                <filter>
                                    <artifact>org.bouncycastle:bcprov-jdk15on</artifact>
                                    <excludes>
                                        <exclude>META-INF/**</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <configuration>
                    <ignoredUnusedDeclaredDependencies>
                        <dependency>com.huawei.us:us-common</dependency>
                        <dependency>org.bouncycastle:bcprov-jdk15on</dependency>
                        <dependency>org.apache.zookeeper:zookeeper</dependency>
                    </ignoredUnusedDeclaredDependencies>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
