<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>qacover</artifactId>
	<version>2.2.1</version>
	<packaging>pom</packaging>

	<name>qacover</name>
	<description>QACover - SQL Query Aware Test Data Coverage Evaluation for Java and .Net applications</description>
	<url>http://github.com/giis-uniovi/qacover</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>

		<tdrules.version>4.6.3</tdrules.version>

		<surefire.version>3.5.6</surefire.version>
	</properties>

	<modules>
		<module>qacover-model</module>
		<module>qacover-core</module>
	</modules>

	<dependencyManagement>
		<dependencies>
			<dependency>
				<groupId>io.github.giis-uniovi</groupId>
				<artifactId>tdrules-bom</artifactId>
				<version>${tdrules.version}</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<dependency>
				<groupId>io.github.javiertuya</groupId>
				<artifactId>portable-java</artifactId>
				<version>2.4.4</version>
			</dependency>
			<dependency>
				<groupId>p6spy</groupId>
				<artifactId>p6spy</artifactId>
				<version>3.9.1</version>
			</dependency>
			<dependency>
				<groupId>junit</groupId>
				<artifactId>junit</artifactId>
				<version>4.13.2</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>io.github.javiertuya</groupId>
				<artifactId>visual-assert</artifactId>
				<version>2.6.2</version>
				<scope>test</scope>
			</dependency>
			<!--this dependency is in portable-java, but if not set here
			it will not be included in jar-with-dependencies or uber jars-->
			<dependency>
				<groupId>commons-io</groupId>
				<artifactId>commons-io</artifactId>
				<version>2.22.0</version>
				<scope>compile</scope>
			</dependency>
			<dependency>
				<groupId>commons-dbutils</groupId>
				<artifactId>commons-dbutils</artifactId>
				<version>1.8.1</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>commons-beanutils</groupId>
				<artifactId>commons-beanutils</artifactId>
				<version>1.11.0</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>2.0.18</version> <!--$NO-MVN-MAN-VER$-->
			</dependency>
			<dependency>
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-slf4j2-impl</artifactId>
				<version>2.26.1</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>com.microsoft.sqlserver</groupId>
				<artifactId>mssql-jdbc</artifactId>
				<version>13.4.0.jre8</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.postgresql</groupId>
				<artifactId>postgresql</artifactId>
				<version>42.7.13</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>com.oracle.database.jdbc</groupId>
				<artifactId>ojdbc8</artifactId>
				<version>23.26.2.0.0</version>
				<!-- v23 does not work in windows (should use v21), returns
				java.sql.SQLException: ORA-01005: null password given; logon denied
				<version>21.15.0.0</version>
				-->
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>org.xerial</groupId>
				<artifactId>sqlite-jdbc</artifactId>
				<version>3.53.2.0</version>
				<scope>test</scope>
			</dependency>
			<dependency>
				<groupId>com.h2database</groupId>
				<artifactId>h2</artifactId>
				<version>2.2.224</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>
						<execution>
							<id>it-reports</id>
							<phase>integration-test</phase>
							<goals>
								<goal>failsafe-report-only</goal>
							</goals>
							<configuration>
								<outputName>failsafe-report</outputName>
							</configuration>
						</execution>
					</executions>
				</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>build-helper-maven-plugin</artifactId>
				<version>3.6.1</version>
				<executions>
					<execution>
						<id>add-test-source</id>
						<phase>generate-test-sources</phase>
						<goals>
							<goal>add-test-source</goal>
						</goals>
						<configuration>
							<sources>
								<source>src/it/java</source>
							</sources>
						</configuration>
					</execution>
				</executions>
			</plugin>
				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>0.8.15</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.2.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>
						<execution>
							<id>junit-reports-with-it</id>
							<phase>post-integration-test</phase>
							<configuration>
								<target unless="skipITs">
									<junitreport>
										<fileset dir="${project.basedir}/target/surefire-reports" erroronmissingdir="false">
											<include name="**/*.xml" />
										</fileset>
										<fileset dir="${project.basedir}/target/failsafe-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.17</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.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>
					<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/giis-uniovi/*</url>
			<snapshots>
				<enabled>true</enabled>
			</snapshots>
      		<releases>
        		<enabled>false</enabled>
			</releases>
		</repository>
		<repository>
			<id>github-javiertuya</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/qacover/blob/main/LICENSE</url>
		</license>
	</licenses>
	<scm>
		<url>https://github.com/giis-uniovi/qacover</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/qacover</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.11.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>
				<!--
				<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>
