<?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.selcukes</groupId>
    <artifactId>selcukes-parent</artifactId>
    <packaging>pom</packaging>
    <version>2.2.7</version>

    <modules>
        <module>selcukes-commons</module>
        <module>webdriver-binaries</module>
        <module>selcukes-core</module>
        <module>selcukes-testng</module>
        <module>selcukes-reports</module>
        <module>selcukes-notifier</module>
        <module>selcukes-databind</module>
        <module>selcukes-junit</module>
        <module>selcukes-extent-reports</module>
        <module>selcukes-snapshot</module>
        <module>selcukes-excel-runner</module>
        <module>video-recorder</module>
        <module>selcukes-java</module>
        <module>selcukes-bom</module>
    </modules>

    <name>selcukes-framework</name>
    <description>selcukes-framework</description>
    <url>https://github.com/selcukes/selcukes-java</url>
    <inceptionYear>2019</inceptionYear>

    <properties>
        <cucumber.version>7.11.2</cucumber.version>
        <selenium.version>4.8.3</selenium.version>
        <appium.version>8.3.0</appium.version>
        <testng.version>7.7.1</testng.version>
        <junit.version>5.9.2</junit.version>

        <lombok.version>1.18.26</lombok.version>
        <commons.io.version>2.11.0</commons.io.version>
        <jackson.version>2.14.2</jackson.version>
        <commons-compress.version>1.23.0</commons-compress.version>

        <poi.version>5.2.3</poi.version>
        <cucumber-reporting.version>5.7.5</cucumber-reporting.version>
        <extentreports.version>5.0.9</extentreports.version>
        <recorder.version>0.7.7.0</recorder.version>
        <slfj4.version>2.20.0</slfj4.version>

        <!-- sonar -->
        <sonar.organization>selcukes</sonar.organization>
        <sonar.host.url>https://sonarcloud.io</sonar.host.url>

        <!-- Java version -->
        <java.version>11</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>

        <!-- encoding -->
        <project.encoding>UTF-8</project.encoding>
        <project.build.sourceEncoding>${project.encoding}</project.build.sourceEncoding>
        <project.reporting.outputEncoding>${project.encoding}</project.reporting.outputEncoding>

        <!-- plugins -->
        <maven-javadoc-plugin.version>3.5.0</maven-javadoc-plugin.version>
        <maven-source-plugin.version>3.2.1</maven-source-plugin.version>
        <maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
        <nexus-staging-maven-plugin.version>1.6.13</nexus-staging-maven-plugin.version>
    </properties>

    <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:selcukes/selcukes-java.git</connection>
        <developerConnection>scm:git:git@github.com:selcukes/selcukes-java.git</developerConnection>
        <url>scm:git:git@github.com:selcukes/selcukes-java.git</url>
    </scm>

    <developers>
        <developer>
            <id>ramesh</id>
            <name>Ramesh Babu Prudhvi</name>
            <url>https://github.com/RameshBabuPrudhvi</url>
            <roles>
                <role>Owner</role>
            </roles>
        </developer>
    </developers>

    <issueManagement>
        <url>https://github.com/selcukes/selcukes-java/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>

    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commons.io.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-compress</artifactId>
                <version>${commons-compress.version}</version>
            </dependency>
            <dependency>
                <groupId>io.cucumber</groupId>
                <artifactId>cucumber-bom</artifactId>
                <version>${cucumber.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>net.masterthought</groupId>
                <artifactId>cucumber-reporting</artifactId>
                <version>${cucumber-reporting.version}</version>
            </dependency>
            <dependency>
                <groupId>com.github.stephenc.monte</groupId>
                <artifactId>monte-screen-recorder</artifactId>
                <version>${recorder.version}</version>
            </dependency>
            <dependency>
                <groupId>org.seleniumhq.selenium</groupId>
                <artifactId>selenium-java</artifactId>
                <version>${selenium.version}</version>
            </dependency>
            <dependency>
                <groupId>io.appium</groupId>
                <artifactId>java-client</artifactId>
                <version>${appium.version}</version>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>${testng.version}</version>
            </dependency>
            <dependency>
                <groupId>com.aventstack</groupId>
                <artifactId>extentreports</artifactId>
                <version>${extentreports.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.poi</groupId>
                <artifactId>poi-ooxml</artifactId>
                <version>${poi.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j-impl</artifactId>
                <version>${slfj4.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <profiles>
        <profile>
            <!-- Activate the profile by running e.g. mvn clean deploy -DperformRelease=true -->
            <id>release</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <!-- override version of GPG plugin to use new GPG signing features -->
                        <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>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <!-- Attach sources -->
                    <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>
                    <!-- Generate javadocs -->
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven-javadoc-plugin.version}</version>
                    <configuration>
                        <doclint>none</doclint>
                        <encoding>UTF-8</encoding>
                    </configuration>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                </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://oss.sonatype.org/</nexusUrl>
                        <autoReleaseAfterClose>true</autoReleaseAfterClose>
                    </configuration>
                </plugin>

                <!-- Check code format -->
                <plugin>
                    <groupId>com.diffplug.spotless</groupId>
                    <artifactId>spotless-maven-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>spotless-check</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <java>
                            <eclipse>
                                <file>assets/spotless/eclipse-formatter-settings.xml</file>
                            </eclipse>
                            <importOrder>
                                <file>assets/spotless/intellij-idea.importorder</file>
                            </importOrder>
                        </java>
                    </configuration>
                </plugin>

                <!-- Check style -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-checkstyle-plugin</artifactId>
                    <executions>
                        <execution>
                            <id>validate</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <configLocation>assets/checkstyle/checkstyle.xml</configLocation>
                        <consoleOutput>true</consoleOutput>
                        <failOnViolation>true</failOnViolation>
                        <failsOnError>true</failsOnError>
                        <includeTestSourceDirectory>true</includeTestSourceDirectory>
                        <logViolationsToConsole>true</logViolationsToConsole>
                        <violationSeverity>error</violationSeverity>
                    </configuration>
                </plugin>

            </plugins>
        </pluginManagement>
    </build>
</project>
