<?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.prestosql</groupId>
        <artifactId>presto-root</artifactId>
        <version>348</version>
    </parent>

    <artifactId>presto-product-tests</artifactId>
    <name>presto-product-tests</name>

    <properties>
        <air.main.basedir>${project.parent.basedir}</air.main.basedir>
        <main-class>io.prestosql.tests.TemptoProductTestRunner</main-class>
        <air.check.skip-duplicate-finder>true</air.check.skip-duplicate-finder>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.prestosql</groupId>
            <artifactId>presto-hive</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>io.prestosql.hive</groupId>
                    <artifactId>hive-apache</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.httpcomponents</groupId>
                    <artifactId>httpclient</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>io.prestosql</groupId>
            <artifactId>presto-jdbc</artifactId>
        </dependency>

        <dependency>
            <groupId>io.prestosql</groupId>
            <artifactId>presto-testng-services</artifactId>
        </dependency>

        <dependency>
            <groupId>io.prestosql.cassandra</groupId>
            <artifactId>cassandra-driver</artifactId>
        </dependency>

        <dependency>
            <groupId>io.prestosql.hive</groupId>
            <artifactId>hive-apache</artifactId>
        </dependency>

        <dependency>
            <groupId>io.prestosql.tempto</groupId>
            <artifactId>tempto-core</artifactId>
        </dependency>

        <dependency>
            <groupId>io.prestosql.tempto</groupId>
            <artifactId>tempto-kafka</artifactId>
        </dependency>

        <dependency>
            <groupId>io.prestosql.tempto</groupId>
            <artifactId>tempto-ldap</artifactId>
        </dependency>

        <dependency>
            <groupId>io.prestosql.tempto</groupId>
            <artifactId>tempto-runner</artifactId>
        </dependency>

        <dependency>
            <groupId>io.airlift</groupId>
            <artifactId>http-client</artifactId>
        </dependency>

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

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

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

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

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

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

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

        <dependency>
            <groupId>org.apache.thrift</groupId>
            <artifactId>libthrift</artifactId>
        </dependency>

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

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

        <dependency>
            <groupId>io.prestosql.hive</groupId>
            <artifactId>hive-apache-jdbc</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>mssql-jdbc</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>

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

        <dependency>
            <groupId>org.xerial.snappy</groupId>
            <artifactId>snappy-java</artifactId>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>presto-cli-version.txt</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <excludes>
                    <exclude>presto-cli-version.txt</exclude>
                </excludes>
            </resource>
        </resources>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <!--
                            presto-product-tests has a dependency on SQL Server (mssql-jdbc) which is a signed jar.
                            Its invalidated when we repackage it into an uber jar. Hence to avoid
                            Error: A JNI error has occurred, please check your installation and try again
                            Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes

                            We remove signed information from META-INF
                            -->
                            <filters>
                                <filter>
                                    <artifact>*:*</artifact>
                                    <excludes>
                                        <exclude>META-INF/*.SF</exclude>
                                        <exclude>META-INF/*.DSA</exclude>
                                        <exclude>META-INF/*.RSA</exclude>
                                    </excludes>
                                </filter>
                            </filters>
                            <shadedArtifactAttached>true</shadedArtifactAttached>
                            <shadedClassifierName>executable</shadedClassifierName>
                            <transformers>
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                                <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                    <manifestEntries>
                                        <Main-Class>${main-class}</Main-Class>
                                    </manifestEntries>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
