<?xml version="1.0"?>
<!--
  ~ Copyright (C) 2010-2021 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>gui</artifactId>
        <groupId>com.evolveum.midpoint.gui</groupId>
        <version>4.5-M1</version>
    </parent>

    <artifactId>admin-gui</artifactId>
    <packaging>war</packaging>

    <name>midPoint User Interface - admin web gui</name>

    <properties>
        <server.port></server.port>
        <midpoint.host></midpoint.host>
        <midpoint.home></midpoint.home>
        <midpoint.schrodinger>false</midpoint.schrodinger>
        <javax.net.ssl.trustStore></javax.net.ssl.trustStore>
        <javax.net.ssl.trustStoreType></javax.net.ssl.trustStoreType>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-saml2-service-provider</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-oauth2-client</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-core</artifactId>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.tomcat</groupId>
                    <artifactId>tomcat-annotations-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-actuator-autoconfigure</artifactId>
        </dependency>

        <!-- webjars -->
        <dependency>
            <groupId>com.evolveum.webjars</groupId>
            <artifactId>AdminLTE</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>respond</artifactId>
            <scope>runtime</scope> <!-- needed for javascripts for IE8 -->
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>html5shiv</artifactId>
            <scope>runtime</scope> <!-- needed for javascripts for IE8 -->
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>font-awesome</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.webjars.npm</groupId>
            <artifactId>ionicons</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.webjars</groupId>
            <artifactId>password-score</artifactId>
            <scope>runtime</scope>
        </dependency>

        <!-- WRO4J-->
        <dependency>
            <groupId>ro.isdc.wro4j</groupId>
            <artifactId>wro4j-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.webjars</groupId>
            <artifactId>less</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>ro.isdc.wro4j</groupId>
            <artifactId>wro4j-extensions</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.webjars</groupId>
                    <artifactId>less</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <exclusion>
                    <!-- unused library (13mb) -->
                    <groupId>org.jruby</groupId>
                    <artifactId>jruby-core</artifactId>
                </exclusion>
                <exclusion>
                    <!-- unused library -->
                    <groupId>org.jruby</groupId>
                    <artifactId>jruby-stdlib</artifactId>
                </exclusion>
                <exclusion>
                    <!-- unused library (500kb) -->
                    <groupId>me.n4u.sass</groupId>
                    <artifactId>sass-gems</artifactId>
                </exclusion>
                <exclusion>
                    <!-- unused library (200kb) -->
                    <groupId>nz.co.edmi</groupId>
                    <artifactId>bourbon-gem-jar</artifactId>
                </exclusion>
                <exclusion>
                    <!-- unused library (3.5mb) -->
                    <groupId>com.google.javascript</groupId>
                    <artifactId>closure-compiler</artifactId>
                </exclusion>
                <exclusion>
                    <!-- unused library -->
                    <groupId>org.webjars</groupId>
                    <artifactId>coffee-script</artifactId>
                </exclusion>
                <exclusion>
                    <!-- unused library -->
                    <groupId>org.codehaus.gmaven.runtime</groupId>
                    <artifactId>gmaven-runtime-1.7</artifactId>
                </exclusion>
                <exclusion>
                    <!-- unused library -->
                    <groupId>com.github.lltyk</groupId>
                    <artifactId>dojo-shrinksafe</artifactId>
                </exclusion>
                <exclusion>
                    <!-- unused library -->
                    <groupId>org.webjars</groupId>
                    <artifactId>emberjs</artifactId>
                </exclusion>
                <exclusion>
                    <!-- unused library -->
                    <groupId>org.webjars.npm</groupId>
                    <artifactId>handlebars</artifactId>
                </exclusion>
                <exclusion>
                    <!-- unused library -->
                    <groupId>org.webjars</groupId>
                    <artifactId>json2</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.darrinholst</groupId>
                    <artifactId>sass-java-gems</artifactId>
                </exclusion>
                <exclusion>
                    <!-- unused library -->
                    <groupId>org.webjars.npm</groupId>
                    <artifactId>jshint</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- JDBC DRIVERS -->
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.mariadb.jdbc</groupId>
            <artifactId>mariadb-java-client</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!--
        Following drivers are excluded in repackaging, we don't want to distribute it (or can't).
        -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.microsoft.sqlserver</groupId>
            <artifactId>mssql-jdbc</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.oracle.database.jdbc</groupId>
            <artifactId>ojdbc11</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- MIDPOINT -->
        <dependency>
            <groupId>com.evolveum.commons</groupId>
            <artifactId>util</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.prism</groupId>
            <artifactId>prism-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.prism</groupId>
            <artifactId>prism-impl</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.infra</groupId>
            <artifactId>schema</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>repo-common</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.model</groupId>
            <artifactId>report-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.model</groupId>
            <artifactId>model-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.model</groupId>
            <artifactId>model-common</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>security-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>security-enforcer-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.model</groupId>
            <artifactId>workflow-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.model</groupId>
            <artifactId>certification-api</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>system-init</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- MIDPOINT RUNTIME DEPENDENCIES -->
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>repo-sql-impl</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>repo-sqale</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint</groupId>
            <artifactId>midpoint-localization</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.model</groupId>
            <artifactId>rest-impl</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-all</artifactId>
            <type>pom</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>repo-cache</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>task-quartz-impl</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>audit-log-impl</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>security-impl</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.repo</groupId>
            <artifactId>security-enforcer-impl</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.model</groupId>
            <artifactId>model-impl</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.model</groupId>
            <artifactId>certification-impl</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.model</groupId>
            <artifactId>workflow-impl</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.model</groupId>
            <artifactId>notifications-impl</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.provisioning</groupId>
            <artifactId>provisioning-impl</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.provisioning</groupId>
            <artifactId>ucf-impl-builtin</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.model</groupId>
            <artifactId>report-impl</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.model</groupId>
            <artifactId>authentication-impl</artifactId>
            <version>${project.version}</version>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>com.evolveum.midpoint.infra</groupId>
            <artifactId>common</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>com.evolveum.midpoint.model</groupId>
            <artifactId>authentication-api</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- SPRING -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
        </dependency>
        <dependency> <!-- needed as runtime dependency otherwise spring won't start -->
            <groupId>org.springframework</groupId>
            <artifactId>spring-aspects</artifactId>
            <scope>runtime</scope>
        </dependency>

        <!-- SPRING SECURITY -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
        </dependency>

        <!-- WICKET DEPENDENCIES -->
        <dependency>
            <groupId>org.apache.wicket</groupId>
            <artifactId>wicket-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.wicket</groupId>
            <artifactId>wicket-request</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.wicket</groupId>
            <artifactId>wicket-ioc</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.wicket</groupId>
            <artifactId>wicket-util</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.wicket</groupId>
            <artifactId>wicket-devutils</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.wicket</groupId>
            <artifactId>wicket-auth-roles</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.wicket</groupId>
            <artifactId>wicket-spring</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>*</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.wicket</groupId>
            <artifactId>wicket-extensions</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.wicket</groupId>
            <artifactId>wicket-datetime</artifactId>
        </dependency>

        <dependency>
            <groupId>com.evolveum.chartjs</groupId>
            <artifactId>wicket-chartjs-core</artifactId>
        </dependency>

        <dependency>
            <groupId>commons-validator</groupId>
            <artifactId>commons-validator</artifactId>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
        </dependency>

        <dependency>
            <!-- In LDAP/AD connector we use custom build of HTTP client with CredSSP support.
                 As AD/LDAP connector is bundled then this triggers a conflict in dependency convergence.
                 Therefore explicitly use the custom version. -->
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <!-- In LDAP/AD connector we use custom build of HTTP client with CredSSP support.
                 As AD/LDAP connector is bundled then this triggers a conflict in dependency convergence.
                 Therefore explicitly use the custom version. -->
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-codec</groupId>
            <artifactId>commons-codec</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-configuration2</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-beanutils</groupId>
            <artifactId>commons-beanutils</artifactId>
        </dependency>
        <dependency>
            <groupId>commons-javaflow</groupId>
            <artifactId>commons-javaflow</artifactId>
            <scope>runtime</scope> <!-- TODO: review if we need this dependency -->
        </dependency>
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
        </dependency>
        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>jakarta.mail</artifactId>
        </dependency>
        <dependency>
            <groupId>org.codehaus.janino</groupId>
            <artifactId>janino</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.github.openjson</groupId>
            <artifactId>openjson</artifactId>
        </dependency>


        <!-- Messaging -->
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>artemis-jms-client</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>artemis-core-client</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.activemq</groupId>
            <artifactId>artemis-commons</artifactId>
            <scope>runtime</scope>
        </dependency>

        <!-- TEST -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-test</artifactId>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>com.evolveum.midpoint.infra</groupId>
            <artifactId>test-util</artifactId>
            <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.repo</groupId>
            <artifactId>repo-sql-impl-test</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.icf</groupId>
            <artifactId>dummy-resource</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency><!-- Not used, but required for surefire plugin not to complain -->
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.commons</groupId>
            <artifactId>test-ng</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Dependencies to connectors, just to add to good place in WAR -->
        <dependency>
            <groupId>com.evolveum.polygon</groupId>
            <artifactId>connector-ldap</artifactId>
            <scope>runtime</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-jdk14</artifactId>
                </exclusion>
                <!-- Exclude api-all and connector-common as that would be included in the WAR as a transitive
                     dependency. We do not want that. We only want the api-all from the connector
                     jar that would be loaded by the ConnId. -->
                <exclusion>
                    <groupId>org.apache.directory.api</groupId>
                    <artifactId>api-all</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.evolveum.polygon</groupId>
                    <artifactId>connector-common</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.evolveum.polygon</groupId>
            <artifactId>connector-databasetable</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>com.evolveum.polygon</groupId>
            <artifactId>connector-csv</artifactId>
            <scope>runtime</scope>
        </dependency>

        <!-- end connectors -->

        <!-- report dependency (needed for microsoft office formats) -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
        </dependency>

        <dependency>
            <groupId>com.github.inamik.text.tables</groupId>
            <artifactId>inamik-text-tables</artifactId>
        </dependency>

        <!-- testing dependencies -->
        <dependency>
            <groupId>com.evolveum.midpoint.model</groupId>
            <artifactId>model-test</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

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

    <build>
        <finalName>midpoint</finalName>
        <resources>
            <resource>
                <filtering>false</filtering>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>**/org.identityconnectors.common.logging</exclude>
                </excludes>
            </resource>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/resources</directory>
                <includes>
                    <include>banner.txt</include>
                </includes>
            </resource>
            <!-- ICF LOGGING CONFIGURATION -->
            <resource>
                <targetPath>../midpoint/META-INF/services</targetPath>
                <filtering>false</filtering>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/org.identityconnectors.common.logging</include>
                </includes>
            </resource>
            <resource>
                <filtering>false</filtering>
                <directory>src/main/java</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                    <exclude>**/*.properties</exclude>
                </excludes>
            </resource>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <filtering>false</filtering>
                <directory>src/test/resources</directory>
            </testResource>
            <testResource>
                <filtering>false</filtering>
                <directory>src/test/java</directory>
                <excludes>
                    <exclude>**/*.java</exclude>
                    <exclude>**/*.properties</exclude>
                </excludes>
            </testResource>
            <testResource>
                <filtering>true</filtering>
                <directory>src/test/java</directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>pl.project13.maven</groupId>
                <artifactId>git-commit-id-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>revision</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <verbose>false</verbose>
                    <offline>true</offline>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <!-- TODO question: CAN this argument be active by default, or should be there a different profile defined for this? -->
                    <jvmArguments>-Dserver.port=${server.port} -Dmidpoint.home=${midpoint.home} -Dmidpoint.schrodinger=${midpoint.schrodinger} -Djavax.net.ssl.trustStore=${javax.net.ssl.trustStore} -Djavax.net.ssl.trustStoreType=${javax.net.ssl.trustStoreType}</jvmArguments>
                    <!--
                    TODO: exclude does NOT work for WAR repackaging: https://github.com/spring-projects/spring-boot/issues/15808
                    Also, exclude does NOT exclude transitive dependencies (as of Boot 2.3.3). How crazy is that?!
                    See truezip-maven-plugin plugin lower.
                    <excludes>
                        <exclude>
                            <groupId>mysql</groupId>
                            <artifactId>mysql-connector-java</artifactId>
                        </exclude>
                        <exclude>
                            <groupId>com.microsoft.sqlserver</groupId>
                            <artifactId>mssql-jdbc</artifactId>
                        </exclude>
                        <exclude>
                            <groupId>com.oracle.database.jdbc</groupId>
                            <artifactId>ojdbc11</artifactId>
                        </exclude>
                    </excludes>
                    -->
                </configuration>
                <executions>
                    <execution>
                        <id>repackage-war</id>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <classifier>executable</classifier>
                            <layoutFactory implementation="com.evolveum.midpoint.tools.layout.MidPointWarLayoutFactory"/>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.evolveum.midpoint.tools</groupId>
                        <artifactId>midpoint-boot-layout</artifactId>
                        <version>${project.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>truezip-maven-plugin</artifactId>
                <version>1.2</version>
                <executions>
                    <execution>
                        <id>remove-unwanted-libs</id>
                        <goals>
                            <goal>remove</goal>
                        </goals>
                        <phase>package</phase>
                        <configuration>
                            <fileset>
                                <!-- note how the archive is treated as a normal file directory -->
                                <directory>${project.build.directory}/midpoint-executable.war/WEB-INF/lib-provided</directory>
                                <includes>
                                    <include>ojdbc11-*.jar</include>
                                    <include>ucp-*.jar</include>
                                    <include>oraclepki-*.jar</include>
                                    <include>osdt_cert-*.jar</include>
                                    <include>osdt_core-*.jar</include>
                                    <include>simplefan-*.jar</include>
                                    <include>ons-*.jar</include>
                                    <include>mssql-jdbc-*.jar</include>
                                    <include>mysql-connector-java-*.jar</include>
                                </includes>
                            </fileset>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

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

            <!--
            We use both main and test classes downstream.
            We can't use JAR plugin for main classes, Maven requires different classifier than for
            the main artifact (which is WAR for admin-gui).
            -->
            <plugin>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <attachClasses>true</attachClasses>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <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>
    </profiles>
</project>
