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

    <groupId>xyz.tcheeric</groupId>
    <artifactId>cashu-mint</artifactId>
    <version>0.38.10</version>
    <packaging>pom</packaging>

    <name>cashu-mint</name>
    <url>http://maven.apache.org</url>
    <modules>
        <module>cashu-mint-tools</module>
        <module>cashu-mint-protocol</module>
        <module>cashu-mint-jpa</module>
        <module>cashu-mint-observability</module>
        <module>cashu-mint-webhook</module>
        <module>cashu-mint-rest</module>
        <module>cashu-mint-rest-it</module>
        <!-- Admin modules (git submodule: cashu-mint-admin).
             The AGGREGATOR is listed, not its children. It already declares all
             four mint-admin-* modules, so naming them here as well duplicates
             them in the reactor and the build refuses to start.
             Listing the children instead of the aggregator was the original
             mistake: every mint-admin-* module declares
             xyz.tcheeric:cashu-mint-admin as its parent, but that pom was then
             outside the reactor, so it was never built and never deployed — 404
             at every version. The modules published fine and nobody outside
             this build could resolve them, because their parent did not exist.
             See #359. -->
        <module>cashu-mint-admin</module>
    </modules>

    <properties>
        <!-- The E2E compose stack runs images built from this reactor rather than
             published ones. Building them costs time, so only the e2e-tests
             profile turns it on. -->
        <e2e.image.skip>true</e2e.image.skip>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <java.version>21</java.version>
        <!-- Skipped by default; integration-tests profile overrides to false -->
        <skip.integration-tests>true</skip.integration-tests>

        <!-- Nostr Java Ecosystem Versions -->
        <!-- 2.x consolidated the 1.x module set (base/crypto/id/util/api/encryption)
             into core/event/client/identity. Bumped for the cashu-ledger trace
             publisher (spec 036) which signs/publishes over nostr-java-core 2.x. -->
        <nostr-java.version>2.3.1</nostr-java.version>

        <!-- Cashu Ecosystem Versions.

             These come from imani-bom, imported first in dependencyManagement.
             Only versions the BOM does NOT manage are pinned here. -->
        <imani-bom.version>0.1.98</imani-bom.version>
        <!-- Not a dependency pin: the mint-admin E2E suite passes this to
             testcontainers to choose the cashu-vault IMAGE, so the service it
             starts matches the client library the BOM resolves. Kept in step
             with imani-bom's cashu-vault.version by hand, because an image tag
             is not something a BOM can manage. -->
        <!-- KNOWN STALE. The newest cashu-vault image published to docker.398ja.xyz is
             0.9.1; every value since is a tag that does not exist, so the opt-in e2e suite
             cannot start its vault container whatever this says. Left at the last value
             rather than advanced to 0.12.5, because moving a pointer to a second
             nonexistent tag would imply it had been checked. Tracked in cashu-vault#144,
             whose root cause is the same: cashu-vault has published nothing since 0.12.1,
             images included. -->
        <cashu-vault.version>0.12.1</cashu-vault.version>
        <payment-adapter.version>0.14.2</payment-adapter.version>
        <!-- Own modules; keep in step with <version> above on every release. -->
        <cashu-mint.version>0.38.4</cashu-mint.version>
        <cashu-client.version>1.2.8</cashu-client.version>
        <!-- Spring Boot (imported as BOM) -->
        <!-- Kept only because submodules write ${spring-boot.version} on
             individual starters. The Boot BOM itself is imported by imani-bom,
             NOT here: a local spring-boot-dependencies import would be read
             before the Imani one and would quietly reinstate Tomcat 10.1.55,
             which still carries three CRITICALs including two authentication
             bypasses. Keep this equal to the BOM's spring-boot.version. -->
        <spring-boot.version>3.5.16</spring-boot.version>

        <!-- Shared Dependency Versions (from nostr-java-bom) -->
        <!-- BouncyCastle comes from imani-bom (1.84). Pinned locally at 1.81
             it silently overrode the BOM and kept CVE-2025-14813 live.
        <bcprov-jdk18on.version>1.81</bcprov-jdk18on.version> -->
        <commons-lang3.version>3.18.0</commons-lang3.version>
        <commons-text.version>1.12.0</commons-text.version>
        <jackson.version>2.18.8</jackson.version>
        <jackson-module-blackbird.version>2.19.2</jackson-module-blackbird.version>
        <slf4j.version>2.0.17</slf4j.version>

        <!-- Test Dependency Versions (from nostr-java-bom) -->
        <junit.version>5.12.2</junit.version>
        <junit.platform.version>1.12.2</junit.platform.version>
        <assertj.version>3.27.7</assertj.version>
        <mockito.version>5.2.0</mockito.version>
        <byte-buddy.version>1.15.4</byte-buddy.version>
        <testcontainers.version>1.21.3</testcontainers.version>
        <guava.version>33.4.8-jre</guava.version>
        <awaitility.version>4.3.0</awaitility.version>

        <!-- Cashu-specific Dependency Versions -->
        <postgresql.version>42.7.12</postgresql.version>
        <h2.version>2.2.224</h2.version>
        <flyway.version>11.2.0</flyway.version>
        <hibernate-envers.version>6.6.1.Final</hibernate-envers.version>
        <picocli.version>4.7.6</picocli.version>
        <commons-beanutils.version>1.11.0</commons-beanutils.version>
        <argon2-jvm.version>2.11</argon2-jvm.version>
        <jakarta-validation.version>3.1.0</jakarta-validation.version>
        <hibernate-validator.version>8.0.1.Final</hibernate-validator.version>
        <jakarta-el.version>4.0.2</jakarta-el.version>
        <resilience4j.version>2.1.0</resilience4j.version>
        <logback.version>1.5.25</logback.version>
        <!-- 10.1.59, not what Boot ships. Boot 3.5.16 carries 10.1.55, which
             OSV still reports as three CRITICALs including CVE-2026-43512 and
             CVE-2026-65905, both authentication bypasses. The advisories name
             10.1.58 as the fix, but that was never published to Maven Central
             (the index skips .57 to .59), so the real floor is 10.1.59. -->
        <tomcat.version>10.1.59</tomcat.version>
        <wiremock.version>3.9.1</wiremock.version>
        <jakarta-servlet-api.version>6.0.0</jakarta-servlet-api.version>
        <jqwik.version>1.8.0</jqwik.version>

        <!-- External tool versions -->
        <phoenixd-java.version>0.3.0</phoenixd-java.version>
        <phoenixd-mock.version>0.3.0</phoenixd-mock.version>

        <!-- Annotation Processors -->
        <lombok.version>1.18.40</lombok.version>

        <!-- Maven Plugin Versions -->
        <maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
        <maven-surefire-plugin.version>3.5.4</maven-surefire-plugin.version>
        <maven-failsafe-plugin.version>3.5.4</maven-failsafe-plugin.version>
        <maven-dependency-plugin.version>3.6.1</maven-dependency-plugin.version>
        <maven-war-plugin.version>3.4.0</maven-war-plugin.version>
        <maven-shade-plugin.version>3.5.1</maven-shade-plugin.version>
        <maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
        <maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
        <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
        <flatten-maven-plugin.version>1.7.2</flatten-maven-plugin.version>
        <jacoco-maven-plugin.version>0.8.13</jacoco-maven-plugin.version>
        <jib-maven-plugin.version>3.4.1</jib-maven-plugin.version>
        <properties-maven-plugin.version>1.0.0</properties-maven-plugin.version>
        <spring-boot-maven-plugin.version>3.5.10</spring-boot-maven-plugin.version>
        <spotless-maven-plugin.version>2.44.5</spotless-maven-plugin.version>
        <google-java-format.version>1.36.1</google-java-format.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Import the Imani BOM.

                 FIRST, because Maven resolves imported BOMs in declaration
                 order and the first to manage an artifact wins. This is the
                 one place the cashu ecosystem versions are decided, so it has
                 to be ahead of anything that might also name them.

                 It is imported rather than restated because a local pin on a
                 BOM-managed artifact never fails the build, it just silently
                 wins — which is exactly how the mint came to run cashu-lib
                 0.30.0 while the rest of the stack was on 0.30.1.

                 Spring Boot is NO LONGER pinned locally. It used to be,
                 because this reactor ran 3.5.10 while the BOM carried 3.5.5,
                 so the local import had to keep it ahead. The BOM now carries
                 3.5.16 along with an explicit Tomcat 10.1.59 override, and
                 that override only works from the POM that declares it BEFORE
                 spring-boot-dependencies. A local Boot import here would be
                 read first and would quietly reinstate Tomcat 10.1.55, which
                 still carries three CRITICALs including two authentication
                 bypasses. Take Boot from the BOM. -->
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>imani-bom</artifactId>
                <version>${imani-bom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- Import JUnit BOM -->
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- NAP Java (issue #372) -->

            <!-- cashu-ledger trace producer SDK (spec 036) -->

            <!-- Nostr Java Modules (2.x set: core/event/client/identity) -->
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>nostr-java-core</artifactId>
                <version>${nostr-java.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>nostr-java-event</artifactId>
                <version>${nostr-java.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>nostr-java-client</artifactId>
                <version>${nostr-java.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>nostr-java-identity</artifactId>
                <version>${nostr-java.version}</version>
            </dependency>

            <!-- bcprov-jdk18on is managed by imani-bom (1.85); a local entry
                 here would silently win and keep the CVE live. -->
            <!-- bcprov-jdk15to18 arrives transitively via bitcoinj at 1.80,
                 which the same CVEs affect, and nothing declares it.

                 1.84 to 1.85 for CVE-2026-8763 (CRITICAL): X.509 Name
                 Constraints can be bypassed with a trailing dot in an
                 rfc822Name or URI, so a certificate can claim a name the
                 constraint was written to forbid. Found by the SBOM-based
                 dependency scan from #432; the file-based scan it replaced
                 reported zero findings against this same tree. -->
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk15to18</artifactId>
                <version>1.85</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-lang3</artifactId>
                <version>${commons-lang3.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-text</artifactId>
                <version>${commons-text.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-core</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-cbor</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.datatype</groupId>
                <artifactId>jackson-datatype-jsr310</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.module</groupId>
                <artifactId>jackson-module-blackbird</artifactId>
                <version>${jackson-module-blackbird.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>

            <!-- Test Dependencies (from nostr-java-bom) -->
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-commons</artifactId>
                <version>${junit.platform.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-engine</artifactId>
                <version>${junit.platform.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-launcher</artifactId>
                <version>${junit.platform.version}</version>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${assertj.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.mockito</groupId>
                <artifactId>mockito-inline</artifactId>
                <version>${mockito.version}</version>
                <scope>test</scope>
            </dependency>
            <!-- byte-buddy is pinned for version convergence only. Its scope is
                 deliberately NOT test: Hibernate pulls it in at compile scope for
                 its BytecodeProvider, and a test-scoped entry here overrides that
                 transitive scope, so the jar is absent from the runtime image.
                 The mint then boots, runs Flyway, and fails building the
                 EntityManagerFactory with NoClassDefFoundError:
                 net/bytebuddy/description/type/TypeDefinition — only when
                 cashu.mint.jpa.enabled=true, which is why unit-test boots and
                 dev profiles never showed it. byte-buddy-agent below stays
                 test-scoped; that one really is only used by Mockito. -->
            <dependency>
                <groupId>net.bytebuddy</groupId>
                <artifactId>byte-buddy</artifactId>
                <version>${byte-buddy.version}</version>
            </dependency>
            <dependency>
                <groupId>net.bytebuddy</groupId>
                <artifactId>byte-buddy-agent</artifactId>
                <version>${byte-buddy.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers</artifactId>
                <version>${testcontainers.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${testcontainers.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.awaitility</groupId>
                <artifactId>awaitility</artifactId>
                <version>${awaitility.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- Cashu Library Modules -->

            <!-- Cashu Voucher Modules -->

            <!-- Payment Adapter Modules -->
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>payment-adapter-model</artifactId>
                <version>${payment-adapter.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>payment-adapter-rest</artifactId>
                <version>${payment-adapter.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>payment-adapter-client</artifactId>
                <version>${payment-adapter.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>payment-adapter-ln-phoenixd</artifactId>
                <version>${payment-adapter.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>payment-adapter-webhook</artifactId>
                <version>${payment-adapter.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>payment-adapter-ln-dummy</artifactId>
                <version>${payment-adapter.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>payment-adapter-common</artifactId>
                <version>${payment-adapter.version}</version>
            </dependency>

            <!-- Cashu Vault Modules -->

            <!-- Cashu Mint Modules -->
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>cashu-mint-tools</artifactId>
                <version>${cashu-mint.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>cashu-mint-protocol</artifactId>
                <version>${cashu-mint.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>cashu-mint-observability</artifactId>
                <version>${cashu-mint.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>cashu-mint-jpa</artifactId>
                <version>${cashu-mint.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>cashu-mint-rest</artifactId>
                <version>${cashu-mint.version}</version>
            </dependency>

            <!-- Cashu Wallet Modules -->

            <!-- Cashu Client Modules -->
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>wallet-core</artifactId>
                <version>${cashu-client.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>wallet-storage-file</artifactId>
                <version>${cashu-client.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>wallet-storage-h2</artifactId>
                <version>${cashu-client.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>wallet-cli</artifactId>
                <version>${cashu-client.version}</version>
            </dependency>

            <!-- Nostr-Cashu Bridge Modules -->
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>nostr-cashu-nips</artifactId>
                <version>${nostr-cashu.version}</version>
            </dependency>

            <!-- Database Dependencies -->
            <dependency>
                <groupId>org.postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <version>${postgresql.version}</version>
            </dependency>
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>${h2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.flywaydb</groupId>
                <artifactId>flyway-core</artifactId>
                <version>${flyway.version}</version>
            </dependency>
            <dependency>
                <groupId>org.flywaydb</groupId>
                <artifactId>flyway-database-postgresql</artifactId>
                <version>${flyway.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-envers</artifactId>
                <version>${hibernate-envers.version}</version>
            </dependency>

            <!-- CLI Dependencies -->
            <dependency>
                <groupId>info.picocli</groupId>
                <artifactId>picocli</artifactId>
                <version>${picocli.version}</version>
            </dependency>

            <!-- Utility Dependencies -->
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>commons-beanutils</groupId>
                <artifactId>commons-beanutils</artifactId>
                <version>${commons-beanutils.version}</version>
            </dependency>
            <dependency>
                <groupId>de.mkammerer</groupId>
                <artifactId>argon2-jvm</artifactId>
                <version>${argon2-jvm.version}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.validation</groupId>
                <artifactId>jakarta.validation-api</artifactId>
                <version>${jakarta-validation.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate.validator</groupId>
                <artifactId>hibernate-validator</artifactId>
                <version>${hibernate-validator.version}</version>
            </dependency>
            <dependency>
                <groupId>org.glassfish</groupId>
                <artifactId>jakarta.el</artifactId>
                <version>${jakarta-el.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.resilience4j</groupId>
                <artifactId>resilience4j-retry</artifactId>
                <version>${resilience4j.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.resilience4j</groupId>
                <artifactId>resilience4j-circuitbreaker</artifactId>
                <version>${resilience4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-core</artifactId>
                <version>${tomcat.version}</version>
            </dependency>

            <!-- Logging Dependencies -->
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-classic</artifactId>
                <version>${logback.version}</version>
            </dependency>
            <dependency>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</artifactId>
                <version>${logback.version}</version>
            </dependency>

            <!-- External Tool Dependencies -->
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>phoenixd-java</artifactId>
                <version>${phoenixd-java.version}</version>
            </dependency>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>phoenixd-mock</artifactId>
                <version>${phoenixd-mock.version}</version>
            </dependency>

            <!-- Test Dependencies (additional to nostr-java-bom) -->
            <dependency>
                <groupId>org.wiremock</groupId>
                <artifactId>wiremock</artifactId>
                <version>${wiremock.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>jakarta.servlet</groupId>
                <artifactId>jakarta.servlet-api</artifactId>
                <version>${jakarta-servlet-api.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>net.jqwik</groupId>
                <artifactId>jqwik</artifactId>
                <version>${jqwik.version}</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <distributionManagement>
        <repository>
            <id>reposilite-releases</id>
            <url>https://maven.398ja.xyz/releases</url>
        </repository>
        <snapshotRepository>
            <id>reposilite-snapshots</id>
            <url>https://maven.398ja.xyz/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>reposilite-releases</id>
            <url>https://maven.398ja.xyz/releases</url>
        </repository>
        <repository>
            <id>reposilite-snapshots</id>
            <url>https://maven.398ja.xyz/snapshots</url>
        </repository>
    </repositories>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>${spring-boot-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <source>${java.version}</source>
                        <target>${java.version}</target>
                        <showDeprecation>true</showDeprecation>
                        <annotationProcessorPaths>
                            <annotationProcessorPath>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </annotationProcessorPath>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven-surefire-plugin.version}</version>
                <configuration>
                    <argLine>${argLine} -javaagent:${project.build.directory}/byte-buddy-agent.jar --add-opens=java.base/java.lang=ALL-UNNAMED -Djdk.attach.allowAttachSelf=true</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${maven-failsafe-plugin.version}</version>
                <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>${maven-war-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>${maven-shade-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-enforcer-plugin</artifactId>
                    <version>${maven-enforcer-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven-gpg-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>flatten-maven-plugin</artifactId>
                    <version>${flatten-maven-plugin.version}</version>
                    <configuration>
                        <updatePomFile>true</updatePomFile>
                        <flattenMode>resolveCiFriendliesOnly</flattenMode>
                    </configuration>
                    <executions>
                        <execution>
                            <id>flatten</id>
                            <phase>process-resources</phase>
                            <goals>
                                <goal>flatten</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>flatten.clean</id>
                            <phase>clean</phase>
                            <goals>
                                <goal>clean</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>report</id>
                            <phase>prepare-package</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>com.google.cloud.tools</groupId>
                    <artifactId>jib-maven-plugin</artifactId>
                    <version>${jib-maven-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>properties-maven-plugin</artifactId>
                    <version>${properties-maven-plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.5.0</version>
                <executions>
                    <execution>
                        <id>enforce-java</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireJavaVersion>
                                    <version>[21,22)</version>
                                    <message>Java 21 is required to build and test this project.</message>
                                </requireJavaVersion>
                            </rules>
                            <fail>true</fail>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${maven-dependency-plugin.version}</version>
                <executions>
                    <execution>
                        <id>copy-byte-buddy-agent</id>
                        <phase>generate-test-resources</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>net.bytebuddy</groupId>
                                    <artifactId>byte-buddy-agent</artifactId>
                                    <version>${byte-buddy.version}</version>
                                    <destFileName>byte-buddy-agent.jar</destFileName>
                                    <outputDirectory>${project.build.directory}</outputDirectory>
                                    <overWrite>true</overWrite>
                                </artifactItem>
                            </artifactItems>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
                <version>${spotless-maven-plugin.version}</version>
                <configuration>
                    <java>
                        <includes>
                            <include>src/main/java/**/*.java</include>
                            <include>src/test/java/**/*.java</include>
                        </includes>
                        <removeUnusedImports/>
                        <trimTrailingWhitespace/>
                        <endWithNewline/>
                        <indent>
                            <spaces>true</spaces>
                        </indent>
                    </java>
                </configuration>
                <executions>
                    <execution>
                        <id>spotless-check</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!-- Integration Tests Profile -->
        <!-- E2E tests: mvn verify -Pe2e-tests -->

        <profile>

            <id>e2e-tests</id>

            <properties>

                <e2e.image.skip>false</e2e.image.skip>

            </properties>

        </profile>

        <profile>
            <id>integration-tests</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <properties>
                <skip.integration-tests>false</skip.integration-tests>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-failsafe-plugin</artifactId>
                        <version>3.3.1</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>integration-test</goal>
                                    <goal>verify</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <!-- Include tests ending with IT or IntegrationTest -->
                            <includes>
                                <include>**/*IT.java</include>
                                <include>**/*IntegrationTest.java</include>
                            </includes>
                            <argLine>--add-opens=java.base/java.lang=ALL-UNNAMED -Djdk.attach.allowAttachSelf=true</argLine>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <!-- Skip Integration Tests in Regular Build -->
        <profile>
            <id>skip-integration-tests</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <!-- Exclude integration tests from regular test run -->
                            <excludes>
                                <exclude>**/*IT.java</exclude>
                                <exclude>**/*IntegrationTest.java</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

</project>
