<?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-core</artifactId>
    <version>0.15.5</version>
    <packaging>pom</packaging>
    <name>Imani Gateway Core</name>
    <description>Gateway Core service for account management, authentication, identity resolution, and platform concerns — standalone project extracted from imani-bridge</description>

    <modules>
        <module>gateway-core-rest</module>
        <module>gateway-core-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>

        <imani-bom.version>0.1.98</imani-bom.version>

        <!-- Spec 014 (payment receipts): receipts package added in 0.2.0;
             gateway-core-rest consumes PaymentReceiptIssuedEvent /
             PaymentReceiptDelivery / PaymentReceiptAck records. Bump
             to track the messaging-contracts release that ships those
             records (currently scaffolded in 014 T001). -->

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

        <!-- 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>

        <!-- Observability -->
        <micrometer-tracing.version>1.4.4</micrometer-tracing.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>

            <!-- Identity modules -->


            <!-- Gateway API (DTOs + ports) -->

            <!-- 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 -->

            <!-- NAP Java (Nostr Authentication Protocol) -->


            <!-- Spec 014 (payment receipts) — JMS message contracts -->

            <!-- Internal modules -->
            <dependency>
                <groupId>xyz.tcheeric</groupId>
                <artifactId>gateway-core-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>
                    </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>

    <!--
        Resolution sources. Without these declared at the project level
        Maven only knows about Maven Central, and dependencies on
        xyz.tcheeric:* (imani-bom, imani-commons, imani-security,
        messaging-contracts, …) fail to resolve in CI environments
        that don't have a host-side ~/.m2/settings.xml mirror entry.

        Mirrors the pattern in messaging-contracts/pom.xml so the two
        repos resolve dependencies the same way.
    -->
    <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>
            <releases><enabled>true</enabled></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </repository>
        <repository>
            <id>reposilite-snapshots</id>
            <url>https://maven.398ja.xyz/snapshots</url>
            <releases><enabled>false</enabled></releases>
            <snapshots><enabled>true</enabled></snapshots>
        </repository>
    </repositories>

</project>
