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

    <groupId>xyz.tcheeric</groupId>
    <artifactId>imani-gateway-customer</artifactId>
    <version>0.18.1</version>
    <packaging>pom</packaging>
    <name>Imani Gateway Customer Wallet</name>
    <description>Customer Wallet Service for wallet operations, voucher management, token DMs, mint operations, wallet sync, and Nostr queries — standalone project extracted from imani-bridge</description>

    <modules>
        <module>gateway-customer-rest</module>
        <module>gateway-customer-it</module>
    </modules>

    <properties>
        <java.version>21</java.version>
        <maven.compiler.source>${java.version}</maven.compiler.source>
        <maven.compiler.target>${java.version}</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <!-- 0.1.62 for the P2PK_VOUCHER set. The composite NUT-10 kind needs
             cashu-lib 0.29.0, cashu-voucher 0.13.0 and cashu-mint 0.35.0
             TOGETHER: a 0.29.0 lib against a mint older than 0.35.0 dispatches
             the kind to a condition that never checks a witness, which makes
             the lock advisory and defeats the point of having it. The BOM pins
             the three as a set, which is why this moves as one number.

             0.1.59 resolved cashu-lib 0.28.0, where P2PKVoucherSecret does not
             exist at all. -->
        <imani-bom.version>0.1.126</imani-bom.version>
        <!-- imani-gateway-api and imani-wallet versions are now sourced from imani-bom 0.1.15
             (gateway-api 0.1.6, wallet 0.1.10). Local overrides removed; bump the BOM to move. -->


        <!-- Integration Test Defaults -->
        <skipITs>true</skipITs>
        <skipITs.customer>true</skipITs.customer>

        <!-- Build Plugin Versions -->
        <maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
        <maven.surefire.plugin.version>3.5.2</maven.surefire.plugin.version>
        <maven.failsafe.plugin.version>3.2.5</maven.failsafe.plugin.version>
        <spring-boot-maven-plugin.version>3.5.5</spring-boot-maven-plugin.version>
        <jib-maven-plugin.version>3.4.0</jib-maven-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>imani-bom</artifactId>
                <version>${imani-bom.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- imani-gateway-api, wallet-core-nostr, wallet-core-app, wallet-core-cashu,
                 and wallet-core-base versions are managed by imani-bom above. The local
                 dependencyManagement entries that previously redeclared them have been
                 removed in favour of the BOM as single source of truth. -->

            <!-- imani-security is managed by imani-bom above (0.1.3). It was pinned here
                 to 0.1.0, which silently overrode the BOM and kept this service on the
                 pre-CRIT-1 filter. Bump the BOM to move it. -->

            <!-- Nostrdb -->

            <!-- Internal modules -->

            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>gateway-customer-rest</artifactId>
                <version>${project.version}</version>
            </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>
                        <parameters>true</parameters>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven.surefire.plugin.version}</version>
                    <configuration>
                        <useModulePath>false</useModulePath>
                        <!-- A deadlock in a test must fail the build, not hang it. A virtual-thread
                             pinning regression (#153) freezes the whole test JVM, including JUnit's
                             own timeout thread, so only a limit enforced from outside the JVM works. -->
                        <forkedProcessTimeoutInSeconds>1800</forkedProcessTimeoutInSeconds>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven.failsafe.plugin.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <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>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
            <releases><enabled>true</enabled></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </repository>
        <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>

</project>
