<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>io.github.giis-uniovi</groupId>
	<artifactId>tdrules</artifactId>
	<version>3.5.0</version>
	<packaging>pom</packaging>

	<name>tdrules</name>
	<description>TdRules - Test Data Coverage Evaluation</description>
	<url>http://github.com/giis-uniovi/tdrules</url>
	<organization>
		<name>Software Engineering Research Group (GIIS) - Universidad de Oviedo, ES</name>
		<url>http://giis.uniovi.es/</url>
	</organization>

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

		<surefire.version>3.1.2</surefire.version>
		
		<portable.version>2.2.0</portable.version>

		<logback.version>1.2.12</logback.version>

		<httpclient-version>5.2.1</httpclient-version>
		
		<!-- datagen still using httpclient4, pending migration -->
		<httpclient4-version>4.5.14</httpclient4-version>
		
		<mockserver.version>5.15.0</mockserver.version>

		<openapi.generator.version>6.6.0</openapi.generator.version>
	</properties>

	<modules>
		<module>tdrules-model</module>
		<module>tdrules-client</module>
		<module>tdrules-bom</module>
		<module>tdrules-store-shared</module>
		<module>tdrules-store-rdb</module>
		<module>tdrules-client-rdb</module>
	</modules>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>io.github.javiertuya</groupId>
				<artifactId>portable-java</artifactId>
				<version>${portable.version}</version>
			</dependency>

			<!-- Dependencias para OpenApi (para jackson usa el bom pues hay muchas dependencias) -->
			<dependency>
				<groupId>com.fasterxml.jackson</groupId>
				<artifactId>jackson-bom</artifactId>
				<version>2.15.2</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<!-- HTTP client: apache client -->
			<dependency>
				<groupId>org.apache.httpcomponents.client5</groupId>
				<artifactId>httpclient5</artifactId>
				<version>${httpclient-version}</version>
			</dependency>
			<!-- Aunque openapi usa httpclient5, datagen todavia necesita httpclient4 -->
			<dependency>
				<groupId>org.apache.httpcomponents</groupId>
				<artifactId>httpclient</artifactId>
				<version>${httpclient4-version}</version>
			</dependency>
			<!-- otras dependencias -->
			<dependency>
				<groupId>io.swagger.parser.v3</groupId>
				<artifactId>swagger-parser</artifactId>
				<version>2.1.16</version>
			</dependency>
			<dependency>
				<groupId>io.swagger</groupId>
				<artifactId>swagger-annotations</artifactId>
				<version>1.6.11</version>
			</dependency>
			<dependency>
				<groupId>com.google.code.findbugs</groupId>
				<artifactId>jsr305</artifactId>
				<version>3.0.2</version>
			</dependency>
			<dependency>
				<groupId>javax.annotation</groupId>
				<artifactId>javax.annotation-api</artifactId>
				<version>1.3.2</version>
			</dependency>

			<!-- Mock de servicios, si hay problemas de dependencias usar el artefacto shaded, https://github.com/mock-server/mockserver -->
			<dependency>
				<groupId>org.mock-server</groupId>
				<artifactId>mockserver-netty</artifactId>
				<version>${mockserver.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.mock-server</groupId>
				<artifactId>mockserver-client-java</artifactId>
				<version>${mockserver.version}</version>
				<scope>test</scope>
			</dependency>

			<!-- Logs, el api es runtime, y usa logback para log en los tests -->
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>2.0.7</version>
			</dependency>
			<dependency>
				<groupId>ch.qos.logback</groupId>
				<artifactId>logback-classic</artifactId>
				<version>${logback.version}</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>ch.qos.logback</groupId>
				<artifactId>logback-core</artifactId>
				<version>${logback.version}</version>
				<scope>provided</scope>
			</dependency>

			<!--Exclusivas para ejecucion de test -->
			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>4.13.2</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>pl.pragmatists</groupId>
				<artifactId>JUnitParams</artifactId>
				<version>1.1.1</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>io.github.javiertuya</groupId>
				<artifactId>visual-assert</artifactId>
				<version>2.4.1</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>commons-io</groupId>
				<artifactId>commons-io</artifactId>
				<version>2.13.0</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>commons-dbutils</groupId>
				<artifactId>commons-dbutils</artifactId>
				<version>1.7</version>
				<scope>test</scope>
			</dependency>
			
			<!-- test databases for store rdb -->
			<dependency>
				<groupId>com.microsoft.sqlserver</groupId>
				<artifactId>mssql-jdbc</artifactId>
				<version>12.2.0.jre8</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.postgresql</groupId>
				<artifactId>postgresql</artifactId>
				<version>42.6.0</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>com.oracle.database.jdbc</groupId>
				<artifactId>ojdbc8</artifactId>
				<version>21.10.0.0</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.xerial</groupId>
				<artifactId>sqlite-jdbc</artifactId>
				<version>3.42.0.0</version>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<pluginManagement>
			<plugins>
				<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>
				<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>
				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>0.8.10</version>
					<executions>
						<execution>
							<id>pre-unit-test</id>
							<phase>process-test-resources</phase>
							<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-antrun-plugin</artifactId>
					<version>3.1.0</version>
					<executions>
						<!-- Aggregate junit style reports -->
						<execution>
							<id>junit-reports</id>
							<phase>test</phase>
							<configuration>
								<target unless="skipTests">
									<junitreport>
										<fileset dir="${project.basedir}/target/surefire-reports" erroronmissingdir="false">
											<include name="**/*.xml" />
										</fileset>
										<report format="frames" todir="${project.reporting.outputDirectory}/junit-frames" />
										<report format="noframes" todir="${project.reporting.outputDirectory}/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.13</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.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.5.0</version>
					<configuration>
						<quiet>true</quiet>
						<doclint>none</doclint>
					</configuration>
					<executions>
						<execution>
							<id>attach-javadocs</id>
							<phase>package</phase>
							<goals>
								<goal>jar</goal>
							</goals>
						</execution>
					</executions>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>

	<repositories>
		<!-- GitHub snapshots repositories -->
		<repository>
			<id>github</id>
			<url>https://maven.pkg.github.com/javiertuya/*</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
      		<releases>
        		<enabled>false</enabled>
			</releases>
		</repository>
	</repositories>

	<developers>
		<developer>
			<name>Javier Tuya</name>
			<url>http://giis.uniovi.es</url>
		</developer>
		<developer>
			<name>Maria Jose Suarez-Cabal</name>
			<url>http://giis.uniovi.es</url>
		</developer>
		<developer>
			<name>Claudio de la Riva</name>
			<url>http://giis.uniovi.es</url>
		</developer>
	</developers>
	<licenses>
		<license>
			<name>Apache-2.0</name>
			<url>https://github.com/giis-uniovi/tdrules/blob/main/LICENSE</url>
		</license>
	</licenses>
	<scm>
		<url>https://github.com/giis-uniovi/tdrules</url>
	</scm>

	<!-- To publish packages (mvn deploy) a profile must be specified (github for snapsots and maven central for releases) -->
	<profiles>
		<profile>
			<id>publish-github</id>
			<distributionManagement>
				<snapshotRepository>
					<id>github</id>
					<name>GitHub Apache Maven Packages</name>
					<url>https://maven.pkg.github.com/giis-uniovi/tdrules</url>
				</snapshotRepository>
			</distributionManagement>
		</profile>
		<profile>
			<id>publish-maven</id>
			<build>
				<plugins>
					<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>1.6.13</version>
						<extensions>true</extensions>
						<configuration>
							<serverId>ossrh</serverId>
							<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>true</autoReleaseAfterClose>
						</configuration>
					</plugin>
					<plugin>
						<groupId>org.apache.maven.plugins</groupId>
						<artifactId>maven-gpg-plugin</artifactId>
						<version>3.1.0</version>
						<executions>
							<execution>
								<id>sign-artifacts</id>
								<phase>verify</phase>
								<goals>
									<goal>sign</goal>
								</goals>
							</execution>
						</executions>
					</plugin>
				</plugins>
			</build>
			<distributionManagement>
				<repository>
					<id>ossrh</id>
					<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
				</repository>
				<snapshotRepository>
					<id>ossrh</id>
					<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
				</snapshotRepository>
			</distributionManagement>
		</profile>
	</profiles>
</project>
