<?xml version="1.0"?>
<!--
  ~ Copyright (C) 2010-2022 Evolveum and contributors
  ~
  ~ This work is dual-licensed under the Apache License 2.0
  ~ and European Union Public License. See LICENSE file for details.
  -->

<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>
        <artifactId>repo</artifactId>
        <groupId>com.evolveum.midpoint.repo</groupId>
        <version>4.8.11</version>
    </parent>

    <artifactId>repo-sql-impl-test</artifactId>
    <packaging>jar</packaging>

    <name>midPoint Repository - sql repository test</name>

    <dependencies>
        <dependency>
            <groupId>com.evolveum.midpoint.infra</groupId>
            <artifactId>common</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>repo-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>audit-api</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>task-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>repo-sql-impl</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>repo-sqale</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-configuration2</artifactId>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
        </dependency>
        <dependency>
            <groupId>com.evolveum.commons</groupId>
            <artifactId>test-ng</artifactId>
        </dependency>
        <dependency>
            <groupId>com.evolveum.commons</groupId>
            <artifactId>util</artifactId>
        </dependency>
        <dependency>
            <groupId>com.evolveum.prism</groupId>
            <artifactId>prism-api</artifactId>
        </dependency>

        <dependency>
            <groupId>com.evolveum.midpoint.infra</groupId>
            <artifactId>test-util</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </dependency>

        <dependency>
            <groupId>jakarta.persistence</groupId>
            <artifactId>jakarta.persistence-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.hibernate.orm</groupId>
            <artifactId>hibernate-core</artifactId>
            <exclusions>
              <exclusion>
                <groupId>javax.annotation</groupId>
                <artifactId>javax.annotation-api</artifactId>
              </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.hibernate.orm</groupId>
            <artifactId>hibernate-ant</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>net.ttddyy</groupId>
            <artifactId>datasource-proxy</artifactId>
        </dependency>

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

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>mssql-jdbc</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.oracle.database.jdbc</groupId>
            <artifactId>ojdbc11</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint</groupId>
            <artifactId>midpoint-localization</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>system-init</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.javabits.jgrapht</groupId>
            <artifactId>jgrapht-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>colt</groupId>
            <artifactId>colt</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
        </dependency>
        <dependency> <!-- needed as runtime dependency otherwise spring won't start -->
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency> <!-- needed as runtime dependency otherwise spring won't start -->
            <groupId>org.springframework</groupId>
            <artifactId>spring-aop</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-sql</artifactId>
            <version>${querydsl.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.querydsl</groupId>
            <artifactId>querydsl-core</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- reference failsafe to run integration tests (surefire/units run by default) -->
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>dbtest</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <suiteXmlFiles>
                                <suiteXmlFile>testng-integration.xml</suiteXmlFile>
                                <suiteXmlFile>testng-db-specific.xml</suiteXmlFile>
                            </suiteXmlFiles>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>perftest</id>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <configuration>
                            <skipTests>false</skipTests>
                            <systemPropertyVariables>
                                <mp.perf.report.prefix>target/PERF</mp.perf.report.prefix>
                            </systemPropertyVariables>
                            <suiteXmlFiles>
                                <suiteXmlFile>testng-perf.xml</suiteXmlFile>
                            </suiteXmlFiles>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <!-- New repo testing - skip all tests from this module -->
            <id>sqale</id>
            <properties>
                <!--
                Skips test execution but still compiles them.
                Without this dependency plugin complains.
                -->
                <maven.test.skip.exec>true</maven.test.skip.exec>
            </properties>
        </profile>
    </profiles>
</project>
