<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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>io.github.ndviet</groupId>
    <artifactId>test-parent-pom</artifactId>
    <name>Test Parent POM</name>
    <version>${revision}</version>
    <description>Test parent POM is used to structure the entire projects.</description>
    <url>https://${github.url}/${github.organization}/${project.artifactId}/tree/${github.branch}</url>
    <packaging>pom</packaging>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>${github.id}</id>
            <name>${github.name}</name>
            <email>${github.email}</email>
            <roles>
                <role>maintainer</role>
                <role>developer</role>
            </roles>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git@${github.url}:${github.organization}/${project.artifactId}.git</connection>
        <developerConnection>scm:git:ssh://git@${github.url}:${github.organization}/${project.artifactId}.git
        </developerConnection>
        <url>https://${github.url}/${github.organization}/${project.artifactId}/tree/${github.branch}</url>
    </scm>

    <properties>
        <github.url>github.com</github.url>
        <github.id>ndviet</github.id>
        <github.email>nguyenducviet4496@gmail.com</github.email>
        <github.name>Nguyen Duc Viet</github.name>
        <github.organization>vietnd96</github.organization>
        <github.branch>master</github.branch>
        <revision>23.1.6</revision>
        <test-automation-fwk.version>${revision}</test-automation-fwk.version>
        <test-java2robot-adapter.version>${revision}</test-java2robot-adapter.version>
        <maven-shade-plugin.version>3.4.1</maven-shade-plugin.version>
        <maven-dependency-plugin.version>3.3.0</maven-dependency-plugin.version>
        <flatten-maven-plugin.version>1.3.0</flatten-maven-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.4.1</maven-javadoc-plugin.version>
        <maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.7</nexus-staging-maven-plugin.version>
        <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
        <robotframework-maven-plugin.version>2.1.0</robotframework-maven-plugin.version>
        <properties-maven-plugin.version>1.0.0</properties-maven-plugin.version>
        <gmaven-plugin.version>1.3</gmaven-plugin.version>
        <webdriverextensions-maven-plugin.version>3.4.0</webdriverextensions-maven-plugin.version>
        <webdriverextensions.version>3.11.2</webdriverextensions.version>
        <selenium-java.version>4.6.0</selenium-java.version>
        <qatools.ashot>1.5.4</qatools.ashot>
        <snakeyaml.version>1.33</snakeyaml.version>
        <sshd-core.version>2.9.1</sshd-core.version>
        <commons-io.version>2.11.0</commons-io.version>
        <javalib-core.version>2.0.3</javalib-core.version>
        <json-path.version>2.7.0</json-path.version>
        <log4j2.version>2.19.0</log4j2.version>
        <commons-lang3.version>3.12.0</commons-lang3.version>
        <jackson-databind.version>2.14.1</jackson-databind.version>
        <freemarker.version>2.3.31</freemarker.version>
        <spring-core.version>5.3.24</spring-core.version>
        <javalib-core.version>2.0.3</javalib-core.version>
        <robotframework.version>4.1.2</robotframework.version>
        <rest-assured.version>5.3.0</rest-assured.version>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <release>false</release>
    </properties>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.github.webdriverextensions</groupId>
                <artifactId>webdriverextensions</artifactId>
                <version>${webdriverextensions.version}</version>
            </dependency>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
                <version>${selenium-java.version}</version>
            </dependency>
            <dependency>
                <groupId>ru.yandex.qatools.ashot</groupId>
                <artifactId>ashot</artifactId>
                <version>${qatools.ashot}</version>
            </dependency>
            <dependency>
                <groupId>io.rest-assured</groupId>
                <artifactId>rest-assured</artifactId>
                <version>${rest-assured.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-api</artifactId>
                <version>${log4j2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang3.version}</version>
            </dependency>
            <dependency>
                <groupId>org.yaml</groupId>
                <artifactId>snakeyaml</artifactId>
                <version>${snakeyaml.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.sshd</groupId>
                <artifactId>sshd-core</artifactId>
                <version>${sshd-core.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons-io.version}</version>
            </dependency>
            <dependency>
                <groupId>com.jayway.jsonpath</groupId>
                <artifactId>json-path</artifactId>
                <version>${json-path.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson-databind.version}</version>
            </dependency>
            <dependency>
                <groupId>org.freemarker</groupId>
                <artifactId>freemarker</artifactId>
                <version>${freemarker.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-context-support</artifactId>
                <version>${spring-core.version}</version>
            </dependency>
            <dependency>
                <groupId>org.robotframework</groupId>
                <artifactId>javalib-core</artifactId>
                <version>${javalib-core.version}</version>
            </dependency>
            <dependency>
                <groupId>org.robotframework</groupId>
                <artifactId>robotframework</artifactId>
                <version>${robotframework.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>flatten-maven-plugin</artifactId>
                    <version>${flatten-maven-plugin.version}</version>
                    <configuration>
                        <updatePomFile>true</updatePomFile>
                        <flattenMode>bom</flattenMode>
                        <pomElements>
                            <build>keep</build>
                        </pomElements>
                    </configuration>
                    <executions>
                        <execution>
                            <id>flatten</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>flatten</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>flatten.clean</id>
                            <phase>clean</phase>
                            <goals>
                                <goal>clean</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>${maven-release-plugin.version}</version>
                    <configuration>
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <useReleaseProfile>false</useReleaseProfile>
                        <releaseProfiles>release</releaseProfiles>
                        <goals>deploy nexus-staging:release</goals>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.sonatype.plugins</groupId>
                    <artifactId>nexus-staging-maven-plugin</artifactId>
                    <version>${nexus-staging-maven-plugin.version}</version>
                    <extensions>true</extensions>
                    <configuration>
                        <serverId>ossrh</serverId>
                        <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>${release}</autoReleaseAfterClose>
                        <stagingProgressTimeoutMinutes>20</stagingProgressTimeoutMinutes>
                        <stagingProgressPauseDurationSeconds>5</stagingProgressPauseDurationSeconds>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <configuration>
                        <detectJavaApiLink>false</detectJavaApiLink>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven-source-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.gmaven</groupId>
                    <artifactId>gmaven-plugin</artifactId>
                    <version>${gmaven-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>set-timestamp-property</id>
                            <phase>initialize</phase>
                            <goals>
                                <goal>execute</goal>
                            </goals>
                            <configuration>
                                <source>
                                    def timestamp = new Date().format('yyyyMMDD_HHmmssSSS')
                                    project.properties.setProperty('custom.timestamp', timestamp)
                                </source>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

                <plugin>
                    <groupId>com.github.webdriverextensions</groupId>
                    <artifactId>webdriverextensions-maven-plugin</artifactId>
                    <version>${webdriverextensions-maven-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>${maven-dependency-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.robotframework</groupId>
                    <artifactId>robotframework-maven-plugin</artifactId>
                    <version>${robotframework-maven-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven-shade-plugin.version}</version>
                </plugin>

                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>properties-maven-plugin</artifactId>
                    <version>${properties-maven-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>flatten-pom</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>flatten-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>release</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-release-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>