<?xml version="1.0" encoding="UTF-8"?>
<!--
  im2be-platform-libs — Stage B Wave PLATFORM v1.0 scaffold.

  Shared Spring Boot 3.5.14 / Java 17 libraries for the 8 aim2be Java services
  (admin / calendar / diary / family / notification / social-login / user /
  identity). Adopted as the substrate for the L-1 Full-Spec Library First
  decision per ADR-0014 D-2 + CONT-3 Option A.

  Modules (each shipped as a separate JAR consumed by services via
  dependencyManagement):

    - outbox-publisher          — PG-backed outbox poller + AFTER_COMMIT relay
    - processed-kafka-events    — consumer-side compound-PK dedup
    - apicurio-client           — Apicurio (primary) / Confluent wire-format
                                  (fallback) dual schema-registry abstraction
    - outbox-test-fixtures      — JUnit Jupiter helpers for downstream tests
    - archunit-rules            — @Entity ↔ @Version parity ArchRule + others

  Distribution model (Day-1):
    - Built locally + installed to `~/.m2/repository` via `mvn install`.
    - Published to Forgejo's native Maven package registry on tag push
      (TODO PR-PLATFORM-CI-1: configure `distributionManagement` + the
      `altDeploymentRepository` flag in CI).

  Version policy (per L-21 — Spring Boot harmonization):
    - Spring Boot 3.5.14 baseline (matches L-21 target across all 7 services
      + identity-service).
    - Java 17 (matches Spring Boot 3.5.x minimum).
    - groupId / version are uniform across modules; consumers pin a single
      property `im2be-platform-libs.version` in service POMs.

  Build-time invariants (rule 62 — clean compilation):
    - `mvn install` must exit 0 with ZERO [WARNING] lines.
    - ArchUnit module must publish its own self-test that proves the
      EntityVersionParity rule fires correctly against a deliberate
      negative fixture (lands in PR-PLATFORM-5).

  Cross-refs:
    - ADR-0001 §1.4 — @Version parity ArchUnit rule
    - ADR-0002 §3b — Avro schemas for ticket lifecycle (apicurio-client
                     downstream consumer)
    - ADR-0011 §B  — Apicurio primary, Confluent wire-format fallback
    - ADR-0014 D-2 — outbox + record_version parity, library-first delivery
-->
<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>3.5.14</version>
        <relativePath/>
    </parent>

    <groupId>com.aim2be</groupId>
    <artifactId>im2be-platform-libs-parent</artifactId>
    <version>1.1.0-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>im2be-platform-libs (parent)</name>
    <description>
        Shared Spring Boot libraries for aim2be Java services (Stage B Wave
        PLATFORM v1.0). Outbox publisher, processed-kafka-events dedup,
        Apicurio client, test fixtures, ArchUnit rules.
    </description>

    <modules>
        <module>outbox-publisher</module>
        <module>redis-outbox-backend</module>
        <module>processed-kafka-events</module>
        <module>apicurio-client</module>
        <module>outbox-test-fixtures</module>
        <module>archunit-rules</module>
    </modules>

    <properties>
        <java.version>17</java.version>
        <maven.compiler.source>17</maven.compiler.source>
        <maven.compiler.target>17</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- Pinned third-party versions (rule 9 — pin explicitly, rule 61 —
             verify against current upstream docs before any bump). -->
        <archunit.version>1.3.0</archunit.version>
        <apicurio.client.version>2.5.11.Final</apicurio.client.version>
        <!-- Shared across outbox-publisher + redis-outbox-backend. Verified
             against Maven Central / upstream release pages 2026-05-28. -->
        <resilience4j.version>2.2.0</resilience4j.version>
        <opentelemetry.version>1.43.0</opentelemetry.version>
        <testcontainers.version>1.20.4</testcontainers.version>
    </properties>

    <!--
      Forgejo Maven package registry for the affinity-intelligence-rework org
      (PR-PLATFORM-CI-1). Makes 1.1.0-SNAPSHOT resolvable from a REMOTE so
      consumers (identity-service et al.) no longer rely on a local `mvn install`
      into ~/.m2 — a clean/ephemeral build can resolve the coordinate. Each
      consumer adds a matching <repositories> entry pointing at the same URL; the
      credentials live ONLY in ~/.m2/settings.xml under <server id="forgejo-air">
      (a write:package + read:package Forgejo token), never in the POM.
      Deploy: `mvn -DskipTests deploy` from a JDK17 host (does not need the
      Forgejo Actions runner).
    -->
    <distributionManagement>
        <repository>
            <id>forgejo-air</id>
            <name>Forgejo affinity-intelligence-rework Maven registry</name>
            <url>https://git.hemoglobina.store/api/packages/affinity-intelligence-rework/maven</url>
        </repository>
        <snapshotRepository>
            <id>forgejo-air</id>
            <name>Forgejo affinity-intelligence-rework Maven registry (snapshots)</name>
            <url>https://git.hemoglobina.store/api/packages/affinity-intelligence-rework/maven</url>
        </snapshotRepository>
    </distributionManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <release>17</release>
                        <!-- Rule 62: zero warnings. Treat compiler warnings
                             as errors. Consumers that need to relax this for
                             a specific submodule must justify per rule 18. -->
                        <failOnWarning>true</failOnWarning>
                        <showWarnings>true</showWarnings>
                        <compilerArgs>
                            <arg>-Xlint:all</arg>
                            <arg>-Xlint:-processing</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>3.2.5</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
