<?xml version="1.0" encoding="UTF-8"?>
<!--
~   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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.jdbi.internal</groupId>
        <artifactId>jdbi3-parent</artifactId>
        <version>3.54.0</version>
    </parent>

    <groupId>org.jdbi</groupId>
    <artifactId>jdbi3-testcontainers</artifactId>

    <name>jdbi3 testcontainers</name>
    <description>Support for the testcontainers.org project for testing databases.</description>

    <properties>
        <!-- all tests run docker containers. Run them one by one... -->
        <basepom.test.fork-count>1</basepom.test.fork-count>
        <!-- docker tests run long -->
        <basepom.test.timeout>600</basepom.test.timeout>

        <dep.clickhouse.version>0.9.8</dep.clickhouse.version>
        <dep.db2.version>12.1.4.0</dep.db2.version>
        <dep.trino.version>479</dep.trino.version>
        <dep.yugabyte.version>42.7.3-yb-4</dep.yugabyte.version>

        <moduleName>org.jdbi.v3.testcontainers</moduleName>
    </properties>

    <!-- we need tons of additional JDBC drivers in this one module. So we keep them all here. -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.clickhouse</groupId>
                <artifactId>clickhouse-jdbc</artifactId>
                <version>${dep.clickhouse.version}</version>
                <classifier>all</classifier>
                <!-- -all is supposed to bring all dependencies -->
                <exclusions>
                    <exclusion>
                        <groupId>*</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <dependency>
                <groupId>com.yugabyte</groupId>
                <artifactId>jdbc-yugabytedb</artifactId>
                <version>${dep.yugabyte.version}</version>
            </dependency>

            <dependency>
                <groupId>io.trino</groupId>
                <artifactId>trino-jdbc</artifactId>
                <version>${dep.trino.version}</version>
            </dependency>

            <dependency>
                <groupId>com.ibm.db2</groupId>
                <artifactId>jcc</artifactId>
                <version>${dep.db2.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.jdbi</groupId>
            <artifactId>jdbi3-core</artifactId>
        </dependency>

        <dependency>
            <groupId>org.jdbi</groupId>
            <artifactId>jdbi3-testing</artifactId>
        </dependency>

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

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
        </dependency>

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

        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
        </dependency>

        <!-- keeping the additional testcontainer deps as provided and optional allows dropping in the 1.x.x jars if needed -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers-jdbc</artifactId>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers-junit-jupiter</artifactId>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

        <!-- test deps -->

        <dependency>
            <groupId>org.jdbi</groupId>
            <artifactId>jdbi3-core</artifactId>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jdbi</groupId>
            <artifactId>jdbi3-sqlobject</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.jdbi</groupId>
            <artifactId>jdbi3-sqlobject</artifactId>
            <classifier>tests</classifier>
            <scope>test</scope>
        </dependency>

        <!-- JDBC drivers -->

        <dependency>
            <groupId>com.clickhouse</groupId>
            <artifactId>clickhouse-jdbc</artifactId>
            <classifier>all</classifier>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.yugabyte</groupId>
            <artifactId>jdbc-yugabytedb</artifactId>
            <scope>test</scope>
        </dependency>

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

        <dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.oracle.database.jdbc</groupId>
            <artifactId>ojdbc8</artifactId>
            <scope>test</scope>
        </dependency>

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

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

        <dependency>
            <groupId>com.ibm.db2</groupId>
            <artifactId>jcc</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- containers -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers-mysql</artifactId>
            <scope>test</scope>
        </dependency>

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

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

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

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

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

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

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

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

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

        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers-db2</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.basepom.maven</groupId>
                <artifactId>duplicate-finder-maven-plugin</artifactId>
                <configuration>
                    <exceptions>
                        <exception>
                            <conflictingDependencies>
                                <dependency>
                                    <groupId>com.clickhouse</groupId>
                                    <artifactId>clickhouse-jdbc</artifactId>
                                </dependency>
                                <dependency>
                                    <groupId>org.jspecify</groupId>
                                    <artifactId>jspecify</artifactId>
                                </dependency>
                            </conflictingDependencies>
                            <classes>
                                <class>org.jspecify.annotations.NonNull</class>
                                <class>org.jspecify.annotations.NullMarked</class>
                                <class>org.jspecify.annotations.NullUnmarked</class>
                                <class>org.jspecify.annotations.Nullable</class>
                            </classes>
                        </exception>
                        <exception>
                            <conflictingDependencies>
                                <dependency>
                                    <groupId>com.clickhouse</groupId>
                                    <artifactId>clickhouse-jdbc</artifactId>
                                </dependency>
                                <dependency>
                                    <groupId>com.github.docker-java</groupId>
                                    <artifactId>docker-java-transport-zerodep</artifactId>
                                </dependency>
                            </conflictingDependencies>
                            <resources>
                                <resource>org/publicsuffix/list/effective_tld_names.dat</resource>
                            </resources>
                        </exception>
                    </exceptions>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
