<?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>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>4.0.6</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>
	<groupId>org.raddatz</groupId>
	<artifactId>familienarchiv</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<name>Familienarchiv</name>
	<description>Backend für das Familenarchiv</description>
	<url/>
	<licenses>
		<license/>
	</licenses>
	<developers>
		<developer/>
	</developers>
	<scm>
		<connection/>
		<developerConnection/>
		<tag/>
		<url/>
	</scm>
	<properties>
		<java.version>21</java.version>
	</properties>
	<dependencyManagement>
		<dependencies>
			<!-- opentelemetry-spring-boot-starter:2.27.0 was built against opentelemetry-api:1.61.0,
			     but Spring Boot 4.0.0 BOM only manages 1.55.0 (missing GlobalOpenTelemetry.getOrNoop()).
			     Import the core OTel BOM here to override it before the Spring Boot BOM applies. -->
			<dependency>
				<groupId>io.opentelemetry</groupId>
				<artifactId>opentelemetry-bom</artifactId>
				<version>1.61.0</version>
				<type>pom</type>
				<scope>import</scope>
			</dependency>
			<!-- Force WireMock's ee10 Jetty transitive deps to match Spring Boot's 12.1.8 core -->
			<dependency>
				<groupId>org.eclipse.jetty.ee10</groupId>
				<artifactId>jetty-ee10-servlet</artifactId>
				<version>12.1.8</version>
			</dependency>
			<dependency>
				<groupId>org.eclipse.jetty.ee10</groupId>
				<artifactId>jetty-ee10-servlets</artifactId>
				<version>12.1.8</version>
			</dependency>
			<dependency>
				<groupId>org.eclipse.jetty.ee10</groupId>
				<artifactId>jetty-ee10-webapp</artifactId>
				<version>12.1.8</version>
			</dependency>
			<dependency>
				<groupId>org.eclipse.jetty</groupId>
				<artifactId>jetty-ee</artifactId>
				<version>12.1.8</version>
			</dependency>
		</dependencies>
	</dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator</artifactId>
		</dependency>
		<!-- Spring Boot 4.0 splits Micrometer metrics export (incl. Prometheus scrape endpoint) into its own starter -->
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-micrometer-metrics</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-validation</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-jdbc</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-security</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-session-jdbc</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-webmvc</artifactId>
			<exclusions>
			<exclusion>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-starter-tomcat</artifactId>
			</exclusion>
		</exclusions>
		</dependency>
		<dependency>
			<groupId>org.postgresql</groupId>
			<artifactId>postgresql</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-jetty</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-testcontainers</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.testcontainers</groupId>
			<artifactId>testcontainers-postgresql</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-actuator-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-jdbc-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-security-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-webmvc-test</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.awaitility</groupId>
			<artifactId>awaitility</artifactId>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>com.tngtech.archunit</groupId>
			<artifactId>archunit-junit5</artifactId>
			<version>1.3.0</version>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.wiremock</groupId>
			<artifactId>wiremock-jetty12</artifactId>
			<version>3.9.2</version>
			<scope>test</scope>
		</dependency>
				<!-- Excel Bearbeitung (Apache POI) -->
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi</artifactId>
			<version>5.5.0</version> <!-- Aktuellste Version -->
		</dependency>
		<dependency>
			<groupId>org.apache.poi</groupId>
			<artifactId>poi-ooxml</artifactId>
			<version>5.5.0</version>
		</dependency>

		<!-- S3 Support für MinIO (AWS SDK v2) -->
		<dependency>
			<groupId>software.amazon.awssdk</groupId>
			<artifactId>s3</artifactId>
			<version>2.29.0</version> <!-- Oder aktuellste Stable -->
		</dependency>
		<!-- Nötig für AWS SDK v2 Authentifizierung -->
		<dependency>
			<groupId>software.amazon.awssdk</groupId>
			<artifactId>auth</artifactId>
			<version>2.29.0</version>
		</dependency>
		<dependency>
			<groupId>org.projectlombok</groupId>
			<artifactId>lombok</artifactId>
			<optional>true</optional>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-mail</artifactId>
		</dependency>
		<dependency>
			<groupId>org.flywaydb</groupId>
			<artifactId>flyway-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.flywaydb</groupId>
			<artifactId>flyway-database-postgresql</artifactId>
		</dependency>

		<!-- Caffeine cache + Bucket4j for in-memory rate limiting -->
		<dependency>
			<groupId>com.github.ben-manes.caffeine</groupId>
			<artifactId>caffeine</artifactId>
		</dependency>
		<dependency>
			<groupId>com.bucket4j</groupId>
			<artifactId>bucket4j-core</artifactId>
			<version>8.10.1</version>
		</dependency>

		<!-- OpenAPI / Swagger UI — enabled only in the dev Spring profile -->
		<dependency>
			<groupId>org.springdoc</groupId>
			<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
			<version>3.0.2</version>
		</dependency>

		<!-- PDF rendering for training data export and thumbnail generation -->
		<dependency>
			<groupId>org.apache.pdfbox</groupId>
			<artifactId>pdfbox</artifactId>
			<version>3.0.4</version>
		</dependency>

		<!-- TIFF decoding plugin for ImageIO (thumbnail generation from scanned TIFFs) -->
		<dependency>
			<groupId>com.twelvemonkeys.imageio</groupId>
			<artifactId>imageio-tiff</artifactId>
			<version>3.12.0</version>
		</dependency>

		<!-- HTML sanitization for Geschichten rich-text body (defense-in-depth alongside Tiptap on the client) -->
		<dependency>
			<groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
			<artifactId>owasp-java-html-sanitizer</artifactId>
			<version>20260101.1</version>
		</dependency>

		<!-- HTML → plain-text extraction for comment previews -->
		<dependency>
			<groupId>org.jsoup</groupId>
			<artifactId>jsoup</artifactId>
			<version>1.18.1</version>
		</dependency>

		<!-- Observability: Prometheus metrics scrape endpoint (version managed by Spring Boot BOM) -->
		<dependency>
			<groupId>io.micrometer</groupId>
			<artifactId>micrometer-registry-prometheus</artifactId>
		</dependency>

		<!-- Observability: Micrometer → OpenTelemetry tracing bridge (version managed by Spring Boot BOM) -->
		<dependency>
			<groupId>io.micrometer</groupId>
			<artifactId>micrometer-tracing-bridge-otel</artifactId>
		</dependency>

		<!-- Observability: OTel Spring Boot auto-instrumentation — NOT in Spring Boot BOM, pinned explicitly -->
		<dependency>
			<groupId>io.opentelemetry.instrumentation</groupId>
			<artifactId>opentelemetry-spring-boot-starter</artifactId>
			<version>2.27.0</version>
			<exclusions>
				<!-- Excludes AzureAppServiceResourceProvider which references ServiceAttributes.SERVICE_INSTANCE_ID
				     that does not exist in the semconv version pulled by this project. -->
				<exclusion>
					<groupId>io.opentelemetry.contrib</groupId>
					<artifactId>opentelemetry-azure-resources</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

		<!-- Sentry error reporting (GlitchTip-compatible) — sentry-spring-boot-4 is the
		     Spring Boot 4 / Spring Framework 7 compatible module (replaces the jakarta starter
		     which crashes with SF7 due to bean-name generation for triply-nested @Import classes) -->
		<dependency>
			<groupId>io.sentry</groupId>
			<artifactId>sentry-spring-boot-4</artifactId>
			<version>8.41.0</version>
		</dependency>
	</dependencies>


	<profiles>
		<profile>
			<id>dev</id>
			<activation>
				<activeByDefault>true</activeByDefault>
			</activation>
			<properties>
				<spring.profiles.active>dev,e2e</spring.profiles.active>
			</properties>
		</profile>
		<profile>
			<id>prod</id>
			<properties>
				<spring.profiles.active></spring.profiles.active>
			</properties>
		</profile>
	</profiles>

	<build>
		<plugins>
			<plugin>
				<groupId>org.jacoco</groupId>
				<artifactId>jacoco-maven-plugin</artifactId>
				<version>0.8.12</version>
				<configuration>
					<excludes>
						<exclude>**/dto/**</exclude>
						<exclude>**/config/**</exclude>
						<exclude>**/exception/ErrorCode*</exclude>
						<exclude>**/model/**</exclude>
					</excludes>
				</configuration>
				<executions>
					<execution>
						<id>prepare-agent</id>
						<goals><goal>prepare-agent</goal></goals>
					</execution>
					<execution>
						<id>report</id>
						<phase>verify</phase>
						<goals><goal>report</goal></goals>
					</execution>
					<!-- Gate: ratchet at 0.77 — actual measured coverage after drift; raise via #496 -->
					<execution>
						<id>check</id>
						<phase>verify</phase>
						<goals><goal>check</goal></goals>
						<configuration>
							<rules>
								<rule>
									<element>BUNDLE</element>
									<limits>
										<limit>
											<counter>BRANCH</counter>
											<value>COVEREDRATIO</value>
											<minimum>0.77</minimum>
										</limit>
									</limits>
								</rule>
							</rules>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<profiles>
						<profile>${spring.profiles.active}</profile>
					</profiles>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-plugin</artifactId>
				<configuration>
					<forkedProcessTimeoutInSeconds>600</forkedProcessTimeoutInSeconds>
					<systemPropertyVariables>
						<junit.jupiter.execution.timeout.default>90 s</junit.jupiter.execution.timeout.default>
					</systemPropertyVariables>
				</configuration>
			</plugin>
		</plugins>
	</build>

</project>
