<?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>
	<groupId>de.gecheckt</groupId>
	<artifactId>pdf-umbenenner-parent</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>pom</packaging>
	<modules>
		<module>pdf-umbenenner-domain</module>
		<module>pdf-umbenenner-application</module>
		<module>pdf-umbenenner-adapter-in-cli</module>
		<module>pdf-umbenenner-adapter-in-gui</module>
		<module>pdf-umbenenner-adapter-out</module>
		<module>pdf-umbenenner-bootstrap</module>
		<module>pdf-umbenenner-coverage</module>
		<module>pdf-umbenenner-packaging</module>
	</modules>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<maven.compiler.release>21</maven.compiler.release>

		<!-- Build and reporting configuration -->
		<!-- PIT aggregation skip flag: set to true when running coverage module in isolation,
			 false (default) when running as part of the full multi-module build. -->
		<pitest.aggregate.skip>false</pitest.aggregate.skip>

		<!-- Library versions -->
		<javafx.version>21.0.2</javafx.version>
		<log4j.version>2.23.1</log4j.version>
		<pdfbox.version>3.0.2</pdfbox.version>
		<sqlite-jdbc.version>3.45.1.0</sqlite-jdbc.version>
		<json.version>20240303</json.version>
		<junit.version>5.10.2</junit.version>
		<mockito.version>5.11.0</mockito.version>

		<!-- Plugin versions -->
		<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
		<maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
		<maven-failsafe-plugin.version>3.2.5</maven-failsafe-plugin.version>
		<maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version>
		<maven-shade-plugin.version>3.6.0</maven-shade-plugin.version>
		<jacoco-maven-plugin.version>0.8.14</jacoco-maven-plugin.version>
		<pitest.maven.version>1.23.0</pitest.maven.version>
		<pitest.junit5.plugin.version>1.2.3</pitest.junit5.plugin.version>
		<jpackage-maven-plugin.version>1.6.0</jpackage-maven-plugin.version>
	</properties>

	<dependencyManagement>
		<dependencies>
			<!-- Logging -->
			<dependency>
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-api</artifactId>
				<version>${log4j.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-core</artifactId>
				<version>${log4j.version}</version>
			</dependency>
			<dependency>
				<groupId>org.apache.logging.log4j</groupId>
				<artifactId>log4j-slf4j2-impl</artifactId>
				<version>${log4j.version}</version>
			</dependency>

			<!-- PDF processing -->
			<dependency>
				<groupId>org.apache.pdfbox</groupId>
				<artifactId>pdfbox</artifactId>
				<version>${pdfbox.version}</version>
			</dependency>

			<!-- Database -->
			<dependency>
				<groupId>org.xerial</groupId>
				<artifactId>sqlite-jdbc</artifactId>
				<version>${sqlite-jdbc.version}</version>
			</dependency>

			<!-- JSON -->
			<dependency>
				<groupId>org.json</groupId>
				<artifactId>json</artifactId>
				<version>${json.version}</version>
			</dependency>

			<!-- JavaFX (GUI-Modul only) -->
			<dependency>
				<groupId>org.openjfx</groupId>
				<artifactId>javafx-base</artifactId>
				<version>${javafx.version}</version>
				<classifier>win</classifier>
			</dependency>
			<dependency>
				<groupId>org.openjfx</groupId>
				<artifactId>javafx-controls</artifactId>
				<version>${javafx.version}</version>
				<classifier>win</classifier>
			</dependency>
			<dependency>
				<groupId>org.openjfx</groupId>
				<artifactId>javafx-graphics</artifactId>
				<version>${javafx.version}</version>
				<classifier>win</classifier>
			</dependency>

			<!-- Monocle: headless JavaFX platform for GUI smoke tests (test scope only) -->
			<dependency>
				<groupId>org.testfx</groupId>
				<artifactId>openjfx-monocle</artifactId>
				<version>jdk-12.0.1+2</version>
				<scope>test</scope>
			</dependency>

			<!-- Testing -->
			<dependency>
				<groupId>org.junit.jupiter</groupId>
				<artifactId>junit-jupiter</artifactId>
				<version>${junit.version}</version>
				<scope>test</scope>
			</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>
			</dependency>
			<dependency>
				<groupId>org.assertj</groupId>
				<artifactId>assertj-core</artifactId>
				<version>3.25.3</version>
				<scope>test</scope>
			</dependency>
		</dependencies>
	</dependencyManagement>

	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-compiler-plugin</artifactId>
					<version>${maven-compiler-plugin.version}</version>
					<configuration>
						<release>${maven.compiler.release}</release>
						<compilerArgs>
							<arg>-proc:none</arg>
						</compilerArgs>
					</configuration>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-surefire-plugin</artifactId>
					<version>${maven-surefire-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-failsafe-plugin</artifactId>
					<version>${maven-failsafe-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-enforcer-plugin</artifactId>
					<version>${maven-enforcer-plugin.version}</version>
					<executions>
						<execution>
							<id>enforce-java</id>
							<goals>
								<goal>enforce</goal>
							</goals>
							<configuration>
								<rules>
									<requireMavenVersion>
										<version>[3.9,)</version>
									</requireMavenVersion>
									<requireJavaVersion>
										<version>[21,)</version>
									</requireJavaVersion>
								</rules>
							</configuration>
						</execution>
					</executions>
				</plugin>
				<plugin>
					<groupId>org.apache.maven.plugins</groupId>
					<artifactId>maven-shade-plugin</artifactId>
					<version>${maven-shade-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.panteleyev</groupId>
					<artifactId>jpackage-maven-plugin</artifactId>
					<version>${jpackage-maven-plugin.version}</version>
				</plugin>
				<plugin>
					<groupId>org.jacoco</groupId>
					<artifactId>jacoco-maven-plugin</artifactId>
					<version>${jacoco-maven-plugin.version}</version>
					<configuration>
						<!-- Default rule configuration for all modules -->
						<rules>
							<rule>
								<element>BUNDLE</element>
								<limits>
									<limit>
										<counter>LINE</counter>
										<value>COVEREDRATIO</value>
										<minimum>0.70</minimum>
									</limit>
									<limit>
										<counter>BRANCH</counter>
										<value>COVEREDRATIO</value>
										<minimum>0.60</minimum>
									</limit>
								</limits>
							</rule>
						</rules>
					</configuration>
				</plugin>
			</plugins>

		</pluginManagement>

		<plugins>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<executions>
					<execution>
						<id>jacoco-prepare-agent</id>
						<goals>
							<goal>prepare-agent</goal>
						</goals>
					</execution>
				</executions>
			</plugin>

			<plugin>
				<groupId>org.pitest</groupId>
				<artifactId>pitest-maven</artifactId>
				<version>${pitest.maven.version}</version>
				<executions>
					<execution>
						<id>pitest</id>
						<phase>verify</phase>
						<goals>
							<goal>mutationCoverage</goal>
						</goals>
						<configuration>
							<skip>true</skip>
							<coverageThreshold>70</coverageThreshold>
							<mutationThreshold>70</mutationThreshold>
						</configuration>
					</execution>
				</executions>
				<configuration>
					<outputFormats>
						<param>HTML</param>
						<param>XML</param>
					</outputFormats>
					<failWhenNoMutations>false</failWhenNoMutations>
					<exportLineCoverage>true</exportLineCoverage>
				</configuration>
				<dependencies>
					<dependency>
						<groupId>org.pitest</groupId>
						<artifactId>pitest-junit5-plugin</artifactId>
						<version>${pitest.junit5.plugin.version}</version>
					</dependency>
				</dependencies>
			</plugin>
		</plugins>
	</build>
</project>