<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.javiertuya</groupId>
	<artifactId>selema</artifactId>
	<version>4.0.0</version>
	<packaging>jar</packaging>
	<organization>
		<name>Software Engineering Research Group - University of Oviedo, ES</name>
		<url>http://giis.uniovi.es/</url>
	</organization>

	<name>selema</name>
	<description>
	A multi-platform, multi-framework Selenium Test Lifecycle Manager on Java and .NET. Automates the WebDriver instantiation and configuration, providing an unified test log, clues for debugging and integration with CI platforms and Browser services.
	</description>
	<url>https://github.com/javiertuya/selema</url>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.source>11</maven.compiler.source>
		<maven.compiler.target>11</maven.compiler.target>

		<junit-jupiter.version>5.14.0</junit-jupiter.version>

		<junit.version>4.13.2</junit.version>
		
		<surefire.version>3.5.4</surefire.version>
		
		<slf4j.version>2.0.17</slf4j.version>
	</properties>
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${junit.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-engine</artifactId>
			<version>${junit-jupiter.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.jupiter</groupId>
			<artifactId>junit-jupiter-params</artifactId>
			<version>${junit-jupiter.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>org.junit.vintage</groupId>
			<artifactId>junit-vintage-engine</artifactId>
			<version>${junit-jupiter.version}</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>io.github.artsok</groupId>
			<artifactId>rerunner-jupiter</artifactId>
			<version>2.1.6</version>
			<scope>provided</scope>
		</dependency>

		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-java</artifactId>
			<version>4.37.0</version>
			<scope>provided</scope>
		</dependency>
		<dependency>
			<groupId>io.github.bonigarcia</groupId>
			<artifactId>webdrivermanager</artifactId>
			<version>6.3.2</version>
		</dependency>

		<dependency>
			<groupId>io.github.javiertuya</groupId>
			<artifactId>portable-java</artifactId>
			<version>2.4.3</version>
		</dependency>
		<dependency>
			<groupId>io.github.javiertuya</groupId>
			<artifactId>visual-assert</artifactId>
			<version>2.6.1</version>
		</dependency>

		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-api</artifactId>
			<version>${slf4j.version}</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-reload4j</artifactId>
			<version>${slf4j.version}</version>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.20.0</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.14.1</version>
				<configuration>
					<source>11</source>
					<target>11</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<version>${surefire.version}</version>
				<configuration>
					<testFailureIgnore>true</testFailureIgnore>
					<!-- Sets the VM argument line used when unit tests are run under JaCoCo -->
					<argLine>${surefireArgLine}</argLine>
					<redirectTestOutputToFile>true</redirectTestOutputToFile>
					<!-- 
					evita fallo con jenkins slave linux y openjdk:
					https://stackoverflow.com/questions/23260057/the-forked-vm-terminated-without-saying-properly-goodbye-vm-crash-or-system-exi/53070605
					-->
					<useSystemClassLoader>false</useSystemClassLoader>
					<skipTests>${skipTests}</skipTests>
				</configuration>
			</plugin>

			<!-- jacoco plugin for code coverage, ut, it. Ver: https://www.petrikainulainen.net/programming/maven/creating-code-coverage-reports-for-unit-and-integration-tests-with-the-jacoco-maven-plugin/ -->
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.8.14</version>
				<executions>
					<execution>
						<id>pre-unit-test</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
						<configuration>
							<destFile>${project.build.directory}/coverage-reports/jacoco.exec</destFile>
							<propertyName>surefireArgLine</propertyName>
						</configuration>
					</execution>
					<execution>
						<id>post-unit-test</id>
						<phase>test</phase>
						<goals>
							<goal>report</goal>
						</goals>
						<configuration>
							<dataFile>${project.build.directory}/coverage-reports/jacoco.exec</dataFile>
							<outputDirectory>${project.reporting.outputDirectory}/jacoco</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-report-plugin</artifactId>
				<version>${surefire.version}</version>
				<executions>
					<execution>
						<id>ut-reports</id>
						<phase>test</phase>
						<goals>
							<goal>report-only</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<!-- Otras tareas realizadas con ant -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-antrun-plugin</artifactId>
				<version>3.2.0</version>
				<executions>
					<!-- Reports de test (ut) estilo junit-->
					<execution>
						<id>junit-reports</id>
						<phase>test</phase>
						<configuration>
							<target unless="skipTests">
								<junitreport todir="target/surefire-reports">
									<fileset dir="target/surefire-reports">
										<include name="**/*.xml" />
									</fileset>
									<report format="frames" todir="target/site/junit-frames" />
									<report format="noframes" todir="target/site/junit-noframes" />
								</junitreport>
							</target>
						</configuration>
						<goals>
							<goal>run</goal>
						</goals>
					</execution>
				</executions>
				<dependencies>
					<dependency>
						<groupId>org.apache.ant</groupId>
						<artifactId>ant-junit</artifactId>
						<version>1.10.15</version>
					</dependency>
					<dependency>
						<groupId>org.apache.ant</groupId>
						<artifactId>ant-trax</artifactId>
						<version>1.8.0</version>
					</dependency>
				</dependencies>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>3.3.1</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>
				<configuration>
					<quiet>true</quiet>
					<doclint>none</doclint>
				</configuration>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>

	<profiles>
		<profile>
			<id>publish-github</id>
			<distributionManagement>
   				<snapshotRepository>
					<id>github</id>
					<name>GitHub javiertuya Apache Maven Packages</name>
					<url>https://maven.pkg.github.com/javiertuya/selema</url>
				</snapshotRepository>
			</distributionManagement>
		</profile>
		<profile>
			<id>publish-maven</id>
            <build>
                <plugins>
					<plugin>
						<groupId>org.sonatype.central</groupId>
						<artifactId>central-publishing-maven-plugin</artifactId>
						<version>0.9.0</version>
						<extensions>true</extensions>
						<configuration>
							<publishingServerId>central</publishingServerId>
							<autoPublish>true</autoPublish>
							<waitUntil>published</waitUntil>
						</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>
				</plugins>
			</build>
			<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>
		</profile>
	</profiles>

	<developers>
		<developer>
			<id>javiertuya</id>
			<name>Javier Tuya</name>
			<url>http://giis.uniovi.es</url>
		</developer>
	</developers>

	<licenses>
		<license>
			<name>Apache License 2.0</name>
			<url>https://github.com/javiertuya/selema/blob/main/LICENSE</url>
		</license>
	</licenses>

	<scm>
		<url>https://github.com/javiertuya/selema</url>
	</scm>

</project>