<?xml version="1.0" encoding="UTF-8"?>
<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>
    <groupId>com.capgemini.mrchecker</groupId>
    <artifactId>mrchecker-test-framework</artifactId>
    <version>2022.12.16</version>
    <name>MrChecker</name>
    <description>MrChecker Test Framework is an automated testing framework for functional testing of web applications,
        native mobile apps, webservices and database.
    </description>
    <url>https://github.com/devonfw/devonfw-testing</url>
    <packaging>pom</packaging>

    <organization>
        <name>Capgemini - Software Solution Center</name>
        <url>https://capgeminisoftware.pl/</url>
    </organization>

    <developers>
        <developer>
            <name>Lukasz Stefaniszyn</name>
            <email>lukasz.stefaniszyn@capgemini.com</email>
            <organization>Capgemini - Nearshore Test Center - Poland</organization>
            <organizationUrl>http://nsc.capgemini.com/nearshoretestcenter</organizationUrl>
        </developer>
        <developer>
            <name>Mariusz Kowalski</name>
            <email>mariusz.kowalski@capgemini.com</email>
            <organization>Capgemini - Nearshore Test Center - Poland</organization>
            <organizationUrl>http://nsc.capgemini.com/nearshoretestcenter</organizationUrl>
        </developer>
        <developer>
            <name>Michal Babiarz</name>
            <email>michal.babiarz@capgemini.com</email>
            <organization>Capgemini - Nearshore Test Center - Poland</organization>
            <organizationUrl>http://nsc.capgemini.com/nearshoretestcenter</organizationUrl>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <scm>
        <connection>scm:git:git://github.com/devonfw/devonfw-testing.git</connection>
        <developerConnection>scm:git:ssh://github.com:devonfw/devonfw-testing.git</developerConnection>
        <url>http://github.com/devonfw/devonfw-testing/tree/develop</url>
    </scm>


    <modules>
        <module>mrchecker-core-module</module>
        <module>mrchecker-selenium-module</module>
        <module>mrchecker-security-module</module>
        <module>mrchecker-webapi-module</module>
        <module>mrchecker-mobile-module</module>
        <module>mrchecker-database-module</module>
        <module>mrchecker-cli-module</module>
    </modules>

    <repositories>
        <repository>
            <id>maven-central</id>
            <url>https://repo1.maven.org/maven2</url>
        </repository>
    </repositories>

    <distributionManagement>
        <!-- Repository used as default deploy phase. If you like to deploy
            to Maven Central, then use profile release - "mvn -P release" -->
        <repository>
            <id>Local_repository</id>
            <url>file://${env.BASE_PATH}/usr/share/maven2</url>
        </repository>
    </distributionManagement>


    <properties>
        <project.build.sourceEncoding>UTF8</project.build.sourceEncoding>

        <!-- Report maven generator -->
        <maven-site-plugin.version>3.7.1</maven-site-plugin.version>
        <maven-project-info-reports-plugin.version>3.0.0</maven-project-info-reports-plugin.version>

        <!--  Code coverage tools-->
        <jacoco-maven-plugin.version>0.8.3</jacoco-maven-plugin.version>

        <!-- Java settings -->
        <java.compiler.version>1.8</java.compiler.version>

        <!-- Tests executors -->
        <maven-surefire-plugin.version>3.0.0-M3</maven-surefire-plugin.version>
        <surefire.provider.version>3.0.0-M3</surefire.provider.version>

        <!-- Test tools -->
        <hamcrest.version>1.3</hamcrest.version>
        <junit.jupiter.version>5.9.0</junit.jupiter.version>
        <junit.platform.version>1.9.0</junit.platform.version>
        <junit.vintage.version>5.9.0</junit.vintage.version>
        <junit.params.version>5.9.0</junit.params.version>
        <mockito.version>4.8.0</mockito.version>
        <joda-time.version>2.12.2</joda-time.version>
        <commons-csv.version>1.9.0</commons-csv.version>
        <commons-lang3.version>3.12.0</commons-lang3.version>
        <commons-collections4.version>4.4</commons-collections4.version>

        <!-- Dependency Injection -->
        <guice.version>5.1.0</guice.version>

        <!-- JSON support java 1.8 -->
        <org.json.version>20160810</org.json.version>

        <!-- Hashes sensitive data -->
        <org.jasypt.version>1.9.2</org.jasypt.version>

        <jackson-databind.version>2.11.0</jackson-databind.version>

        <!-- Static analyze settings -->
        <formatter-maven-plugin.version>2.7.1</formatter-maven-plugin.version>
        <style_format.directory>${pom.basedir}/../../resources/style_format</style_format.directory>

        <!--This dependency is necessary for Rest assured plugin. -->
        <rest-assured.version>3.0.6</rest-assured.version>

        <!-- Allure Annotations -->
        <aspectj.version>1.9.9.1</aspectj.version>
        <allure-junit5.version>2.20.1</allure-junit5.version>
        <allure-java-commons.version>2.20.1</allure-java-commons.version>
        <allure-junit-platform.version>2.20.1</allure-junit-platform.version>
        <allure-maven.version>2.12.0</allure-maven.version>
    </properties>

    <dependencyManagement>
        <dependencies>

            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-surefire-provider</artifactId>
                <version>${surefire.provider.version}</version>
            </dependency>

            <dependency>
                <groupId>org.json</groupId>
                <artifactId>json</artifactId>
                <version>${org.json.version}</version>
            </dependency>

            <!-- Hashes sensitive data -->
            <dependency>
                <groupId>org.jasypt</groupId>
                <artifactId>jasypt</artifactId>
                <version>${org.jasypt.version}</version>
            </dependency>

            <!--This dependency is necessary for Rest assured plugin. -->
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>rest-assured</artifactId>
                <version>${rest-assured.version}</version>
            </dependency>

            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>json-schema-validator</artifactId>
                <version>${rest-assured.version}</version>
            </dependency>

            <!--This dependency is necessary for Allure generator plugin. -->
            <dependency>
                <!-- Test listener. Binds Junit exec to Allure annotation -->
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-junit5</artifactId>
                <version>${allure-junit5.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <!-- Test listener. Binds Junit exec to Allure annotation -->
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-junit-platform</artifactId>
                <version>${allure-junit-platform.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <!-- Test listener. Binds Junit exec to Allure annotation -->
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-maven</artifactId>
                <version>${allure-maven.version}</version>
                <scope>test</scope>
            </dependency>

            <dependency>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-java-commons</artifactId>
                <version>${allure-java-commons.version}</version>
            </dependency>

            <dependency>
                <groupId>io.qameta.allure</groupId>
                <artifactId>allure-attachments</artifactId>
                <version>${allure-java-commons.version}</version>
            </dependency>

            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjweaver</artifactId>
                <version>${aspectj.version}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>


    <!-- The bellow dependencies will ba automatically included in modules -->
    <dependencies>

        <!--This dependency is necessary for Dependency Injection plugin. -->
        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <version>${guice.version}</version>
        </dependency>

        <!--This dependency is necessary for JUnit plugin. -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.jupiter.version}</version>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.jupiter.version}</version>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <version>${junit.params.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-runner</artifactId>
            <version>${junit.platform.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
            <version>${junit.vintage.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-commons</artifactId>
            <version>${junit.platform.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-engine</artifactId>
            <version>${junit.platform.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-launcher</artifactId>
            <version>${junit.platform.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.junit.platform</groupId>
            <artifactId>junit-platform-console-standalone</artifactId>
            <version>${junit.platform.version}</version>
        </dependency>

        <!-- Test tools -->
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>${hamcrest.version}</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
        </dependency>

        <!-- Various tools -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-csv</artifactId>
            <version>${commons-csv.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${commons-lang3.version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-collections4 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>${commons-collections4.version}</version>
        </dependency>

        <!-- For time and date dependency actions -->
        <dependency>
            <groupId>joda-time</groupId>
            <artifactId>joda-time</artifactId>
            <version>${joda-time.version}</version>
        </dependency>

    </dependencies>

    <!-- Build goals/actions -->
    <build>
        <pluginManagement>
            <plugins>

                <!-- CLEAN -->
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.0.0</version>
                    <configuration>
                        <filesets>
                            <fileset>
                                <directory>logs</directory>
                                <followSymlinks>false</followSymlinks>
                            </fileset>
                        </filesets>
                    </configuration>
                </plugin>

                <!-- COMPILE -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.8.1</version>
                    <configuration>
                        <source>${java.compiler.version}</source>
                        <target>${java.compiler.version}</target>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <testSource>${java.compiler.version}</testSource>
                        <testTarget>${java.compiler.version}</testTarget>
                        <showDeprecation>true</showDeprecation>
                        <showWarnings>true</showWarnings>
                    </configuration>
                </plugin>

                <!-- STATIC ANALYZE -->
                <plugin><!-- mvn formatter:format OR mvn formatter:validate -->
                    <groupId>net.revelc.code.formatter</groupId>
                    <artifactId>formatter-maven-plugin</artifactId>
                    <version>${formatter-maven-plugin.version}</version>
                    <configuration>
                        <configFile>${style_format.directory}/eclipse_format_code_standards.xml</configFile>
                        <!--<lineEnding>LF</lineEnding> -->
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <compilerSource>${java.compiler.version}</compilerSource>
                        <compilerCompliance>${java.compiler.version}</compilerCompliance>
                        <compilerTargetPlatform>${java.compiler.version}</compilerTargetPlatform>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>verify</phase>
                            <goals>
                                <goal>validate</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <!-- RUN CLASSIC JUNIT TESTS -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <includes>
                            <include>**/*.class</include>
                        </includes>
                        <excludes>
                            <exclude>**/RawTest.*</exclude>
                            <exclude>**/OutboxDocumentTest.*</exclude>
                        </excludes>
                        <argLine>
                            -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                            ${surefireArgLine}
                        </argLine>
                        <properties>
                            <property>
                                <name>listener</name>
                                <value>io.qameta.allure.junit5.AllureJunit5</value>
                            </property>
                        </properties>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>org.aspectj</groupId>
                            <artifactId>aspectjweaver</artifactId>
                            <version>${aspectj.version}</version>
                        </dependency>
                        <dependency>
                            <groupId>org.apache.maven.surefire</groupId>
                            <artifactId>surefire-api</artifactId>
                            <version>${maven-surefire-plugin.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>

                <!-- Generate report for maven site goal -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-site-plugin</artifactId>
                    <version>${maven-site-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>${maven-project-info-reports-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>io.qameta.allure</groupId>
                    <artifactId>allure-maven</artifactId>
                    <version>${allure-maven.version}</version>
                    <configuration>
                        <reportVersion>2.4.1</reportVersion>
                    </configuration>
                </plugin>
            </plugins>

        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>8</source>
                    <target>8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>prepare-tests</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <destFile>${project.build.directory}/jacoco.exec</destFile>
                            <propertyName>surefireArgLine</propertyName>
                        </configuration>
                    </execution>
                    <execution>
                        <id>coverage-report</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <!-- RELEASE -->
            <id>release</id>
            <distributionManagement>
                <snapshotRepository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
                </snapshotRepository>
                <repository>
                    <id>ossrh</id>
                    <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                </repository>
            </distributionManagement>
            <build>

                <plugins>
                    <!-- Generate source files, but as a fake file.
                        To generate real source:
                        1. Remove node <exclude>*.*</exclude>
                        2. Disable copy-rename-maven-plugin where source
                        file is overwritten
                    -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>verify</phase>
                                <configuration>
                                    <excludes>
                                        <!-- <exclude>*.*</exclude> -->
                                    </excludes>
                                </configuration>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <!-- Generate javadoc files -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.10.4</version>
                        <configuration>
                            <excludePackageNames>*.internal.*</excludePackageNames>
                            <failOnError>false</failOnError>
                            <additionalparam>-Xdoclint:none</additionalparam>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>


                    <!-- <plugin>
                        <groupId>com.coderplus.maven.plugins</groupId>
                        <artifactId>copy-rename-maven-plugin</artifactId>
                        <version>1.0</version>
                        <executions>
                        <execution>
                        <id>copy-file</id>
                        <phase>verify</phase>
                        <goals>
                        <goal>copy</goal>
                        </goals>
                        <configuration>
                        <fileSets>
                        <fileSet>
                        <sourceFile>project-version-sources.jar</sourceFile>
                        <destinationFile>${project.build.directory}/${project.artifactId}-${project.version}-sources.jar</destinationFile>
                        </fileSet>
                        </fileSets>
                        </configuration>
                        </execution>
                        </executions>
                        </plugin> -->

                    <!-- Sign with GPG files -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                    <!-- Prevent `gpg` from using pinentry programs -->
                                    <gpgArguments>
                                        <arg>--pinentry-mode</arg>
                                        <arg>loopback</arg>
                                        <arg>--batch</arg>
                                    </gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Generate list of licenses. mvn -P release -DskipTests=true
                        site -->
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <version>1.14</version>
                        <executions>
                            <execution>
                                <id>download-licenses</id>
                                <goals>
                                    <goal>download-licenses</goal>
                                    <goal>aggregate-download-licenses</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>


                    <!-- Push to Nexus -->
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>1.6.7</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>

            <reporting>
                <excludeDefaults>true</excludeDefaults>
                <plugins>
                    <!-- Report project information -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-project-info-reports-plugin</artifactId>
                        <version>${maven-project-info-reports-plugin.version}</version>
                        <reportSets>
                            <reportSet>
                                <reports>
                                    <report>dependencies</report>
                                    <report>index</report>
                                    <report>issue-management</report>
                                    <report>licenses</report>
                                    <report>mailing-lists</report>
                                    <report>modules</report>
                                    <report>plugin-management</report>
                                    <report>plugins</report>
                                    <report>team</report>
                                    <report>scm</report>
                                    <report>summary</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                </plugins>
            </reporting>

        </profile>


        <profile>
            <id>default</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>

                    <!-- Validate software environment, like Java, Maven version -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-enforcer-plugin</artifactId>
                        <version>3.0.0-M2</version>
                        <executions>
                            <execution>
                                <id>default-cli</id>
                                <goals>
                                    <goal>enforce</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <requireMavenVersion>
                                            <version>3.3.9</version>
                                        </requireMavenVersion>
                                        <requireJavaVersion>
                                            <version>1.8</version>
                                        </requireJavaVersion>
                                    </rules>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

    </profiles>

    <reporting>
        <excludeDefaults>true</excludeDefaults>
        <plugins>
            <!-- Report project information -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>${maven-project-info-reports-plugin.version}</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>index</report>
                            <report>issue-management</report>
                            <report>licenses</report>
                            <report>mailing-lists</report>
                            <report>modules</report>
                            <report>plugin-management</report>
                            <report>plugins</report>
                            <report>team</report>
                            <report>scm</report>
                            <report>summary</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

</project>
