<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>eu.michael-simons.neo4j</groupId>
		<artifactId>neo4j-migrations-quarkus-parent</artifactId>
		<version>1.5.2</version>
	</parent>

	<artifactId>neo4j-migrations-quarkus-deployment</artifactId>

	<name>Neo4j Migrations (Quarkus Deployment)</name>
	<description>Deployment steps for the Quarkus integration of Neo4j Migrations.</description>

	<properties>
		<java-module-name>ac.simons.neo4j.migrations.quarkus.deployment</java-module-name>
		<sonar.coverage.jacoco.xmlReportPaths>${basedir}/../../${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
	</properties>

	<dependencies>
		<dependency>
			<groupId>eu.michael-simons.neo4j</groupId>
			<artifactId>neo4j-migrations-quarkus</artifactId>
			<version>${project.version}</version>
		</dependency>
		<dependency>
			<groupId>io.quarkiverse.neo4j</groupId>
			<artifactId>quarkus-neo4j-deployment</artifactId>
		</dependency>
		<dependency>
			<groupId>io.quarkus</groupId>
			<artifactId>quarkus-arc-deployment</artifactId>
		</dependency>
		<dependency>
			<groupId>io.quarkus</groupId>
			<artifactId>quarkus-junit5-internal</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.quarkus</groupId>
			<artifactId>quarkus-resteasy</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>io.rest-assured</groupId>
			<artifactId>rest-assured</artifactId>
			<scope>test</scope>
			<exclusions>
				<exclusion>
					<groupId>org.apache.commons</groupId>
					<artifactId>commons-lang3</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.assertj</groupId>
			<artifactId>assertj-core</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.jacoco</groupId>
			<artifactId>org.jacoco.agent</artifactId>
			<version>${jacoco-maven-plugin.version}</version>
			<classifier>runtime</classifier>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.testcontainers</groupId>
			<artifactId>junit-jupiter</artifactId>
			<scope>test</scope>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<executions>
					<!-- Sadly, the instrumentation is necessary twice, as the instrumented classes would end up in the jar files other wise -->
					<execution>
						<id>instrument-ut</id>
						<goals>
							<goal>instrument</goal>
						</goals>
					</execution>
					<execution>
						<id>restore-ut</id>
						<goals>
							<goal>restore-instrumented-classes</goal>
						</goals>
					</execution>
					<execution>
						<id>instrument-it</id>
						<goals>
							<goal>instrument</goal>
						</goals>
						<phase>pre-integration-test</phase>
					</execution>
					<execution>
						<id>report-and-check</id>
						<goals>
							<goal>restore-instrumented-classes</goal>
							<!-- Those are configured in the main parent pom, need to be repeated here, so that the restauration of the instrumented classes happens before -->
							<goal>report</goal>
							<goal>check</goal>
						</goals>
						<phase>post-integration-test</phase>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration combine.self="append">
					<annotationProcessorPaths>
						<path>
							<groupId>io.quarkus</groupId>
							<artifactId>quarkus-extension-processor</artifactId>
							<version>${quarkus.version}</version>
						</path>
					</annotationProcessorPaths>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-javadoc-plugin</artifactId>
				<configuration combine.self="append">
					<!-- That will cause generated sources to be ignored -->
					<sourcepath>${project.build.sourceDirectory}</sourcepath>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration combine.self="append">
					<argLine>-Xverify:all</argLine>
					<systemPropertyVariables>
						<jacoco-agent.destfile>${project.build.directory}/jacoco.exec</jacoco-agent.destfile>
						<jacoco-agent.append>true</jacoco-agent.append>
					</systemPropertyVariables>
				</configuration>
			</plugin>
			<plugin>
				<artifactId>maven-failsafe-plugin</artifactId>
				<configuration combine.self="append">
					<argLine>-Xverify:all</argLine>
					<classesDirectory>${project.build.outputDirectory}</classesDirectory>
					<systemPropertyVariables>
						<jacoco-agent.destfile>${project.build.directory}/jacoco.exec</jacoco-agent.destfile>
						<jacoco-agent.append>true</jacoco-agent.append>
						<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
						<maven.home>${maven.home}</maven.home>
					</systemPropertyVariables>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
