<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>com.finconsgroup.itserr.marketplace</groupId>
        <artifactId>wp2-be-audit-dm</artifactId>
        <version>1.0.0</version>
        <relativePath>..</relativePath>
    </parent>

    <artifactId>wp2-be-audit-dm-server</artifactId>
    <packaging>jar</packaging>
    <name>wp2-be-audit-dm-server</name>
    <description>Audit Dm Application</description>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>

        <!-- WP2 Core Library Logging -->
        <dependency>
            <groupId>com.finconsgroup.itserr.marketplace</groupId>
            <artifactId>core-logging</artifactId>
        </dependency>

        <!-- WP2 Core Library Web -->
        <dependency>
            <groupId>com.finconsgroup.itserr.marketplace</groupId>
            <artifactId>core-web</artifactId>
        </dependency>

        <!-- WP2 Core Library Data JPA -->
        <dependency>
            <groupId>com.finconsgroup.itserr.marketplace</groupId>
            <artifactId>core-data-jpa</artifactId>
        </dependency>

        <!-- WP2 Core Library Metrics -->
        <dependency>
            <groupId>com.finconsgroup.itserr.marketplace</groupId>
            <artifactId>core-metrics</artifactId>
        </dependency>

        <!-- WP2 Core Library i18n -->
        <dependency>
            <groupId>com.finconsgroup.itserr.marketplace</groupId>
            <artifactId>core-i18n</artifactId>
        </dependency>

        <!-- WP2 Audit DM Client -->
        <dependency>
            <groupId>com.finconsgroup.itserr.marketplace</groupId>
            <artifactId>wp2-be-audit-dm-client</artifactId>
        </dependency>

        <!-- Postgresql -->
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
        </dependency>

        <!-- Open Api SpringDoc -->
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
        </dependency>

        <!-- Mapstruct -->
        <dependency>
            <groupId>org.mapstruct</groupId>
            <artifactId>mapstruct</artifactId>
        </dependency>

        <!-- Rest Assured -->
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- Test Containers -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Test Containers Postgres -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>postgresql</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- WP2 Core Library Web Test -->
        <dependency>
            <groupId>com.finconsgroup.itserr.marketplace</groupId>
            <artifactId>core-web-test</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <build>
        <plugins>

            <!-- Maven Compiler Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </path>
                        <path>
                            <groupId>org.mapstruct</groupId>
                            <artifactId>mapstruct-processor</artifactId>
                        </path>
                        <path>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok-mapstruct-binding</artifactId>
                        </path>
                    </annotationProcessorPaths>
                    <compilerArgs>
                        -Amapstruct.unmappedTargetPolicy=ERROR
                    </compilerArgs>
                </configuration>
            </plugin>

            <!-- Surefire Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <!--
                    -javaagent:...
                    Added to fix java agent warning while running tests
                    Dynamic loading of agents will be disallowed by default in a future release
                    https://stackoverflow.com/a/79213258/9714611
                    -->
                    <!--
                    -Xshare:off
                    Disable Class Data Sharing (CDS) during test execution to avoid JVM warnings like:
                    "Sharing is only supported for boot loader classes because bootstrap classpath has been appended".
                    This setting applies only to tests run by the Maven Surefire Plugin.
                    -->
                    <argLine>-javaagent:${settings.localRepository}/org/mockito/mockito-core/${mockito.version}/mockito-core-${mockito.version}.jar -Xshare:off @{argLine}</argLine>

                    <includes>
                        <include>**/*Test.java</include>
                        <include>**/*IT.java</include>
                    </includes>
                </configuration>
            </plugin>

            <!--  Jacoco Plugin -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-plugin.version}</version>
                <executions>
                    <execution>
                        <id>prepare-agent</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
</project>
