<?xml version="1.0"?>
<!--
  ~ Copyright (C) 2010-2022 Evolveum and contributors
  ~
  ~ Licensed under the EUPL-1.2 or later.
  -->

<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.11-M1</version>
    </parent>

    <artifactId>repo-common</artifactId>
    <packaging>jar</packaging>

    <name>midPoint Repo Commons</name>

    <dependencies>
        <dependency>
            <groupId>com.evolveum.commons</groupId>
            <artifactId>util</artifactId>
        </dependency>
        <dependency>
            <groupId>com.evolveum.axiom</groupId>
            <artifactId>axiom</artifactId>
        </dependency>
        <dependency>
            <groupId>com.evolveum.prism</groupId>
            <artifactId>prism-api</artifactId>
        </dependency>

        <dependency>
            <groupId>com.evolveum.midpoint.infra</groupId>
            <artifactId>schema</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.infra</groupId>
            <artifactId>common</artifactId>
            <version>${project.version}</version>
        </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-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>security-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <!--
        TODO: this one is strange, it's the only repo non-api dependency and seems to be needed
        for one line: RepositoryCache.enterLocalCaches... in AbstractSearchIterativeResultHandler
        -->
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>repo-cache</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>audit-api</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-csv</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-text</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-validator</groupId>
            <artifactId>commons-validator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.groovy</groupId>
            <artifactId>groovy</artifactId>
        </dependency>
        <dependency>
            <groupId>com.google.guava</groupId>
            <artifactId>guava</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
        </dependency>

        <!-- Testing dependencies -->
        <dependency>
            <groupId>com.evolveum.prism</groupId>
            <artifactId>prism-impl</artifactId>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>task-quartz-impl</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>security-impl</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>audit-log-impl</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>repo-sql-impl-test</artifactId>
            <version>${project.version}</version>
            <scope>test</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>com.evolveum.midpoint.repo</groupId>
            <artifactId>repo-test-util</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.infra</groupId>
            <artifactId>test-util</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.commons</groupId>
            <artifactId>test-ng</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </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>
    </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>
    </profiles>
</project>
