<?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>io.github.fslev</groupId>
    <artifactId>cucumber-jutils</artifactId>
    <version>10.1</version>

    <name>Cucumber JUtils</name>
    <description>A little helper for Cucumber Java</description>
    <url>https://github.com/fslev/cucumber-jutils</url>
    <developers>
        <developer>
            <name>Florin Slevoaca</name>
            <email>slevoaca.florin@gmail.com</email>
            <timezone>EEST</timezone>
        </developer>
    </developers>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <surefire.version>3.5.6</surefire.version>
        <junit.version>6.1.0</junit.version>
        <mockito.version>5.23.0</mockito.version>
        <jtest.utils.version>7.1</jtest.utils.version>
        <cucumber.min.version>6.10.0</cucumber.min.version>
        <guice.min.version>4.2.1</guice.min.version>
        <spring-expression-version>7.0.8</spring-expression-version>
    </properties>

    <dependencies>
        <!--Cucumber-->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-java</artifactId>
            <scope>provided</scope>
            <version>[${cucumber.min.version},)</version>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-guice</artifactId>
            <scope>provided</scope>
            <version>[${cucumber.min.version},)</version>
        </dependency>
        <!--Others-->
        <dependency>
            <groupId>com.google.inject</groupId>
            <artifactId>guice</artifactId>
            <scope>provided</scope>
            <version>[${guice.min.version},)</version>
        </dependency>
        <dependency>
            <groupId>io.github.fslev</groupId>
            <artifactId>jtest-utils</artifactId>
            <version>${jtest.utils.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-expression</artifactId>
            <version>${spring-expression-version}</version>
        </dependency>
        <!-- Test dependencies -->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-junit</artifactId>
            <scope>test</scope>
            <version>[${cucumber.min.version},)</version>
        </dependency>
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-testng</artifactId>
            <scope>test</scope>
            <version>[${cucumber.min.version},)</version>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-junit-jupiter</artifactId>
            <version>${mockito.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.jupiter</groupId>
                    <artifactId>junit-jupiter-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.vintage</groupId>
            <artifactId>junit-vintage-engine</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <profiles>
        <profile>
            <id>junit</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${surefire.version}</version>
                        <executions>
                            <execution>
                                <phase>test</phase>
                            </execution>
                        </executions>
                        <configuration>
                            <!--suppress UnresolvedMavenProperty -->
                            <argLine>${surefireArgLine}</argLine>
                            <testFailureIgnore>false</testFailureIgnore>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>testng</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>${surefire.version}</version>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.maven.surefire</groupId>
                                <artifactId>surefire-testng</artifactId>
                                <version>${surefire.version}</version>
                            </dependency>
                        </dependencies>
                        <executions>
                            <execution>
                                <phase>test</phase>
                            </execution>
                        </executions>
                        <configuration>
                            <!--suppress UnresolvedMavenProperty -->
                            <argLine>${surefireArgLine}</argLine>
                            <testFailureIgnore>false</testFailureIgnore>
                            <parallel>methods</parallel>
                            <threadCount>3</threadCount>
                            <systemPropertyVariables>
                                <testng.dtd.https>false</testng.dtd.https>
                            </systemPropertyVariables>
                            <suiteXmlFiles>
                                <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
                            </suiteXmlFiles>
                            <properties>
                                <property>
                                    <name>dataproviderthreadcount</name>
                                    <value>10</value>
                                </property>
                            </properties>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>nexus-upload</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.4.0</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>3.12.0</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <source>17</source>
                            <doclint>none</doclint>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.8</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <version>0.10.0</version>
                        <extensions>true</extensions>
                        <configuration>
                            <publishingServerId>central</publishingServerId>
                            <autoPublish>true</autoPublish>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>report</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>net.masterthought</groupId>
                        <artifactId>maven-cucumber-reporting</artifactId>
                        <version>5.11.0</version>
                        <executions>
                            <execution>
                                <id>execution</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>generate</goal>
                                </goals>
                                <configuration>
                                    <projectName>cucumber-jutils</projectName>
                                    <skip>false</skip>
                                    <outputDirectory>${project.build.directory}</outputDirectory>
                                    <inputDirectory>${project.build.directory}/cucumber-report</inputDirectory>
                                    <jsonFiles>
                                        <param>report.json</param>
                                    </jsonFiles>
                                    <mergeFeaturesById>false</mergeFeaturesById>
                                    <mergeFeaturesWithRetest>false</mergeFeaturesWithRetest>
                                    <checkBuildResult>false</checkBuildResult>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>coveralls</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.eluder.coveralls</groupId>
                        <artifactId>coveralls-maven-plugin</artifactId>
                        <version>4.3.0</version>
                        <!-- Include JAXB API directly to workaround coveralls-maven-plugin bug in Java 9+
                             https://github.com/trautonen/coveralls-maven-plugin/issues/112 -->
                        <dependencies>
                            <dependency>
                                <groupId>javax.xml.bind</groupId>
                                <artifactId>jaxb-api</artifactId>
                                <version>2.3.1</version>
                            </dependency>
                        </dependencies>
                        <configuration>
                            <!--suppress UnresolvedMavenProperty -->
                            <repoToken>${COVERALLS_TOKEN}</repoToken>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>0.8.14</version>
                        <executions>
                            <execution>
                                <id>default-prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                                <configuration>
                                    <propertyName>surefireArgLine</propertyName>
                                </configuration>
                            </execution>
                            <!-- attached to Maven test phase -->
                            <execution>
                                <id>report</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <testResources>
            <testResource>
                <directory>src/test/resources</directory>
            </testResource>
            <testResource>
                <directory>src/test/resources/config</directory>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.15.0</version>
                <configuration>
                    <release>17</release>
                    <testRelease>17</testRelease>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <scm>
        <connection>scm:git:ssh://git@github.com/fslev/cucumber-jutils.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/fslev/cucumber-jutils.git</developerConnection>
        <url>https://github.com/fslev/cucumber-jutils/tree/master</url>
        <tag>cucumber-jutils-10.1</tag>
    </scm>

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