<?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.github.wizonqalabs.rhino</groupId>
    <artifactId>rhino-pom</artifactId>
    <version>1.0.0</version>
    <packaging>pom</packaging>
    <inceptionYear>2020</inceptionYear>
    <name>${project.groupId}:${project.artifactId}</name>
    <description>Common POM for Rhino suite of Automation frameworks</description>
    <url>https://github.com/wizonqalabs/rhino-pom</url>

    <contributors>
        <contributor>
            <name>Wasiq Bhamla</name>
            <url>https://github.com/WasiqB</url>
            <roles>
                <role>Lead Maintainer</role>
                <role>Developer</role>
            </roles>
            <email>wasbhamla2005@gmail.com</email>
            <organization>WizonQA Labs</organization>
            <organizationUrl>https://github.com/wizonqalabs</organizationUrl>
            <timezone>+5.5</timezone>
        </contributor>
        <contributor>
            <name>Mohammad Faisal Khatri</name>
            <roles>
                <role>Lead QA</role>
            </roles>
            <organization>WizonQA Labs</organization>
            <organizationUrl>https://github.com/wizonqalabs</organizationUrl>
            <timezone>+5.5</timezone>
        </contributor>
    </contributors>

    <developers>
        <developer>
            <name>Wasiq Bhamla</name>
            <url>https://github.com/WasiqB</url>
            <roles>
                <role>Lead Maintainer</role>
                <role>Developer</role>
            </roles>
            <email>wasbhamla2005@gmail.com</email>
            <organization>WizonQA Labs</organization>
            <organizationUrl>https://github.com/wizonqalabs</organizationUrl>
            <timezone>+5.5</timezone>
        </developer>
    </developers>

    <organization>
        <name>WizonQA Labs</name>
        <url>https://github.com/wizonqalabs</url>
    </organization>

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

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/wizonqalabs/rhino-pom/issues</url>
    </issueManagement>

    <scm>
        <connection>scm:git:git@github.com:wizonqalabs/rhino-pom.git</connection>
        <developerConnection>scm:git:git@github.com:wizonqalabs/rhino-pom.git</developerConnection>
        <url>https://github.com/wizonqalabs/rhino-pom</url>
    </scm>

    <ciManagement>
        <system>CircleCI</system>
        <url>https://circleci.com/gh/wizonqalabs/rhino-pom</url>
    </ciManagement>

    <properties>
        <java.version>14</java.version>
        <sonar.jacoco.reportPaths>${project.basedir}/reports/jacoco.exec</sonar.jacoco.reportPaths>
        <argLine>-Dfile.encoding=UTF-8 -Xdebug -Xnoagent --enable-preview</argLine>
        <mvn.compiler>3.8.1</mvn.compiler>
        <mvn.clean>3.1.0</mvn.clean>
        <mvn.resource>3.1.0</mvn.resource>
        <mvn.source>3.2.1</mvn.source>
        <mvn.jdoc>3.2.0</mvn.jdoc>
        <mvn.surefire>3.0.0-M5</mvn.surefire>
        <mvn.version>2.7</mvn.version>
        <mvn.gpg>1.6</mvn.gpg>
        <jacoco>0.8.5</jacoco>
        <sonar>5.14.0.18788</sonar>
        <nexus>1.6.8</nexus>
        <checkstyle>3.1.1</checkstyle>
        <duraspace.checkstyle>1.1.0</duraspace.checkstyle>
        <puppycrawl.checkstyle>8.33</puppycrawl.checkstyle>
        <suite-xml>testng.xml</suite-xml>
    </properties>

    <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>
        <sourceDirectory>src/main/java</sourceDirectory>
        <testSourceDirectory>src/test/java</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>${mvn.clean}</version>
                <executions>
                    <execution>
                        <id>auto-clean</id>
                        <phase>clean</phase>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${mvn.compiler}</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <release>14</release>
                    <compilerArgs>
                        <arg>--enable-preview</arg>
                    </compilerArgs>
                    <forceJavacCompilerUse>true</forceJavacCompilerUse>
                    <parameters>true</parameters>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${mvn.resource}</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>${mvn.source}</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>${mvn.jdoc}</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${mvn.surefire}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <useSystemClassLoader>false</useSystemClassLoader>
                    <properties>
                        <property>
                            <name>usedefaultlisteners</name>
                            <value>false</value>
                        </property>
                    </properties>
                    <suiteXmlFiles>
                        <suiteXmlFile>${suite-xml}</suiteXmlFile>
                    </suiteXmlFiles>
                    <argLine>${argLine}</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
                <version>${mvn.version}</version>
                <configuration>
                    <generateBackupPoms>false</generateBackupPoms>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <destFile>${sonar.jacoco.reportPaths}</destFile>
                            <propertyName>surefireArgLine</propertyName>
                        </configuration>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <dataFile>${sonar.jacoco.reportPaths}</dataFile>
                            <outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>${checkstyle}</version>
                <executions>
                    <execution>
                        <id>verify-style</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <configLocation>${project.basedir}/checkstyle/checkstyle.xml</configLocation>
                    <suppressionsLocation>${project.basedir}/checkstyle/checkstyle-suppressions.xml</suppressionsLocation>
                    <encoding>UTF-8</encoding>
                    <consoleOutput>true</consoleOutput>
                    <logViolationsToConsole>true</logViolationsToConsole>
                    <failOnViolation>true</failOnViolation>
                    <includeTestSourceDirectory>true</includeTestSourceDirectory>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.duraspace</groupId>
                        <artifactId>codestyle</artifactId>
                        <version>${duraspace.checkstyle}</version>
                    </dependency>
                    <dependency>
                        <groupId>com.puppycrawl.tools</groupId>
                        <artifactId>checkstyle</artifactId>
                        <version>${puppycrawl.checkstyle}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>coverage-per-test</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${mvn.surefire}</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <suiteXmlFiles>
                                <suiteXmlFile>${suite-xml}</suiteXmlFile>
                            </suiteXmlFiles>
                            <argLine>${argLine} ${surefireArgLine}</argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
            <dependencies>
                <dependency>
                    <groupId>org.sonarsource.java</groupId>
                    <artifactId>sonar-jacoco-listeners</artifactId>
                    <version>${sonar}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>${mvn.gpg}</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <version>${nexus}</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>