<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (C) 2010-2021 Evolveum and contributors
  ~
 ~ 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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>2.5.2</version>
        <!-- This parent also declares dependencies listed here:
        https://docs.spring.io/spring-boot/docs/2.5.2/reference/html/dependency-versions.html#dependency-versions
        Or for current version of Spring Boot:
        https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-dependency-versions.html
        -->
    </parent>

    <groupId>com.evolveum.midpoint</groupId>
    <artifactId>schrodinger</artifactId>
    <packaging>pom</packaging>
    <version>4.4</version>
    <!-- Notes
            Running GUI tests from Schrodinger module
        mvn clean install  -P build-framework-test
        -->
    <name>midPoint Schrodinger</name>
    <organization>
        <name>evolveum</name>
        <url>https://www.evolveum.com</url>
    </organization>
    <licenses>
        <license>
            <name>Apache License v2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
        <license>
            <name>European Union Public License</name>
            <url>https://joinup.ec.europa.eu/collection/eupl/eupl-text-11-12</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <modules>
        <module>schrodinger-framework</module>
        <module>schrodinger-tests</module>
    </modules>

    <properties>
        <selenium.version>3.141.59</selenium.version>
        <testng.version>7.4.0</testng.version>
        <project.source.version>11</project.source.version>
        <commons.io.version>2.9.0</commons.io.version>
        <slf4j.version>1.7.30</slf4j.version>
        <surefire.version>3.0.0-M5</surefire.version>
        <spring.security.saml2.version>2.0.0.M30</spring.security.saml2.version>
        <quartz.version>2.3.2.e1</quartz.version>
        <hibernate.version>5.5.3.Final</hibernate.version>
        <!--
        Default Spring Boot 2.4.3 uses H2 1.4.200 but that one has NPE bug:
        https://github.com/h2database/h2database/issues/1808
        Sometimes occurs on heavy concurrent test, e.g. on TestDummyParallelism, but also during app run.
        This bug was introduced in 1.4.198, which was major version that also changed queries in OrgClosureManager.
        Between 1.4.197 and 198 changes of OrgClosureManager and around MVCC must be made (see commit history).
        With 1.4.200 TestObjectLifecycleApprovalGlobal fails consistently.
        197 is the last version that does not require code changes, but self-corrupts DB sometimes (MID-6510).
        193 was used for 4 years with few problems, so it's still here to stay.
        -->
        <h2.version>1.4.193</h2.version>
        <guava.version>30.1.1-jre</guava.version>
        <midpoint.version>4.4-SNAPSHOT</midpoint.version>
    </properties>

    <scm>
        <connection>https://github.com/Evolveum/schrodinger.git</connection>
        <developerConnection>git@github.com:Evolveum/schrodinger.git</developerConnection>
        <url>https://github.com/Evolveum/schrodinger.git</url>
    </scm>

    <distributionManagement>
        <repository>
            <id>evolveum-nexus</id>
            <name>Internal Releases</name>
            <url>http://nexus.evolveum.com/nexus/content/repositories/releases/</url>
        </repository>

        <snapshotRepository>
            <id>evolveum-nexus</id>
            <name>Internal Releases</name>
            <url>http://nexus.evolveum.com/nexus/content/repositories/snapshots/</url>
        </snapshotRepository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>evolveum</id>
            <name>Evolveum Public Releases</name>
            <url>https://nexus.evolveum.com/nexus/content/groups/public/</url>
        </repository>
        <repository>
            <id>evolveum-snapshots</id>
            <name>Evolveum Snapshots</name>
            <url>https://nexus.evolveum.com/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>evolveum</id>
            <name>Evolveum</name>
            <url>http://nexus.evolveum.com/nexus/content/groups/public</url>
        </pluginRepository>
    </pluginRepositories>

    <issueManagement>
        <system>Atlassian JIRA</system>
        <url>https://jira.evolveum.com/browse/MID</url>
    </issueManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>${spring-framework.version}</version>
                <exclusions>
                    <!-- replaced with jcl-over-slf4j -->
                    <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring-jcl</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.springframework.security.extensions</groupId>
                <artifactId>spring-security-saml2-core</artifactId>
                <version>${spring.security.saml2.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.bouncycastle</groupId>
                        <artifactId>bcpkix-jdk15on</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.bouncycastle</groupId>
                        <artifactId>bcprov-jdk15on</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.google.code.findbugs</groupId>
                        <artifactId>jsr305</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.codeborne</groupId>
                <artifactId>selenide</artifactId>
                <version>5.3.1</version>
                <exclusions>
                    <!-- Excluding to exclude commons-logging lower -->
                    <exclusion>
                        <groupId>io.netty</groupId>
                        <artifactId>netty-all</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.google.guava</groupId>
                        <artifactId>guava</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
                <version>${selenium.version}</version>
                <exclusions>
                    <!-- replaced by org.slf4j:jcl-over-slf4j -->
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons.io.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>jul-to-slf4j</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>${testng.version}</version>
            </dependency>
            <dependency>
                <groupId>com.evolveum.midpoint.tools</groupId>
                <artifactId>test-ng</artifactId>
                <version>${midpoint.version}</version>
            </dependency>
            <dependency>
                <groupId>com.evolveum.midpoint.repo</groupId>
                <artifactId>repo-sql-impl-test</artifactId>
                <version>${midpoint.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.quartz-scheduler</groupId>
                <artifactId>quartz</artifactId>
                <version>${quartz.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.mchange</groupId>
                        <artifactId>c3p0</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.mchange</groupId>
                        <artifactId>mchange-commons-java</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.zaxxer</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>net.tirasa.connid</groupId>
                <artifactId>connector-framework</artifactId>
                <version>1.5.0.18</version>
            </dependency>
            <dependency>
                <groupId>net.tirasa.connid</groupId>
                <artifactId>connector-framework-internal</artifactId>
                <version>1.5.0.18</version>
            </dependency>

            <!-- todo remove later, taken from mp project-->
<!--            <dependency>-->
<!--                &lt;!&ndash; Resolves dependency conflict in selenium &ndash;&gt;-->
<!--                <groupId>com.squareup.okio</groupId>-->
<!--                <artifactId>okio</artifactId>-->
<!--                <version>1.14.1</version>-->
<!--            </dependency>-->
        </dependencies>
    </dependencyManagement>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.0</version>
                    <configuration>
                        <source>${project.source.version}</source>
                        <target>${project.source.version}</target>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <profiles>
        <profile>
            <id>all-tests</id>
            <modules>
                <module>schrodinger-framework</module>
                <module>schrodinger-tests</module>
            </modules>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${surefire.version}</version>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>configless</id>
            <modules>
                <module>schrodinger-framework</module>
                <module>schrodinger-tests</module>
            </modules>
        </profile>
        <profile>
            <id>fundamental-labs</id>
            <modules>
                <module>schrodinger-framework</module>
                <module>schrodinger-tests</module>
            </modules>
        </profile>
        <profile>
            <id>advanced-labs</id>
            <modules>
                <module>schrodinger-framework</module>
                <module>schrodinger-tests</module>
            </modules>
        </profile>
        <profile>
            <id>build-framework-test</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${surefire.version}</version>
                    </plugin>
                </plugins>
            </build>
            <modules>
                <module>schrodinger-framework</module>
                <module>schrodinger-tests</module>
            </modules>
        </profile>
    </profiles>

</project>
