<?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>
    <parent>
        <groupId>org.pragmatica-lite.aether</groupId>
        <artifactId>aether</artifactId>
        <version>1.0.0-rc2</version>
    </parent>

    <artifactId>aether-deployment</artifactId>
    <name>Aether Deployment</name>
    <description>Cluster and node deployment management</description>

    <properties>
        <!-- Real-PostgreSQL atomicity test (Increment A of #338) and real-MySQL migration test
             (Increment B of #338). TEST scope only; matches the versions used by
             aether/pg-tools/sql-splitter and aether/ember. -->
        <testcontainers.version>1.21.4</testcontainers.version>
        <postgresql-jdbc.version>42.7.5</postgresql-jdbc.version>
        <mysql-jdbc.version>9.2.0</mysql-jdbc.version>
        <!-- The @Tag("heavy-db") real-MySQL migration test is excluded by default (it needs a real
             MySQL container and amd64) and opted into on dedicated hardware (or CI) by overriding
             these two properties:
             mvn test -DheavyDb.excludedGroups= -DheavyDb.includedGroups=heavy-db
             The untagged PostgreSQL tests still run by default. -->
        <heavyDb.excludedGroups>heavy-db</heavyDb.excludedGroups>
        <heavyDb.includedGroups></heavyDb.includedGroups>
    </properties>

    <dependencies>
        <!-- Internal -->
        <dependency>
            <groupId>org.pragmatica-lite</groupId>
            <artifactId>core</artifactId>
        </dependency>
        <!-- @Codec processor: generates the system-level codec registry for this module's
             @Codec types (CommandLifecycleEvent). Aggregated into the node serializer via
             NodeCodecs/WorkerCodecs so the audit StreamPublisher can serialize the events. -->
        <dependency>
            <groupId>org.pragmatica-lite</groupId>
            <artifactId>serialization-codec-processor</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite</groupId>
            <artifactId>utility</artifactId>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite</groupId>
            <artifactId>cluster</artifactId>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite</groupId>
            <artifactId>swim</artifactId>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite</groupId>
            <artifactId>dht</artifactId>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite.aether</groupId>
            <artifactId>aether-dht</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>org.pragmatica-lite.aether</groupId>
            <artifactId>slice-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite.aether</groupId>
            <artifactId>aether-config</artifactId>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite.aether</groupId>
            <artifactId>resource-api</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite.aether</groupId>
            <artifactId>sql-splitter</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite.aether</groupId>
            <artifactId>environment-integration</artifactId>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite.aether</groupId>
            <artifactId>slice</artifactId>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite.aether</groupId>
            <artifactId>artifact-repo</artifactId>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite.aether</groupId>
            <artifactId>aether-metrics</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite.aether</groupId>
            <artifactId>aether-invoke</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite.aether</groupId>
            <artifactId>aether-stream</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite</groupId>
            <artifactId>statemachine</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>

        <!-- Testing -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.pragmatica-lite</groupId>
            <artifactId>statemachine</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <!-- Real-PostgreSQL atomicity test (Increment A of #338): Testcontainers + JDBC driver,
             TEST scope only so neither leaks downstream. The test self-skips (assumeTrue) when no
             Docker daemon is reachable. -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
            <version>${testcontainers.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>postgresql</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>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <version>${postgresql-jdbc.version}</version>
            <scope>test</scope>
        </dependency>
        <!-- Real-MySQL migration test (Increment B of #338): Testcontainers MySQL module + JDBC
             driver, TEST scope only so neither leaks downstream. The driver's transitive X DevAPI
             protobuf dependency is unused here and excluded. The test self-skips (assumeTrue) when no
             Docker daemon is reachable and is gated behind @Tag("heavy-db"). -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>mysql</artifactId>
            <version>${testcontainers.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.mysql</groupId>
            <artifactId>mysql-connector-j</artifactId>
            <version>${mysql-jdbc.version}</version>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.google.protobuf</groupId>
                    <artifactId>protobuf-java</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerArgs combine.children="append">
                        <arg>-Acodec.registry.suffix=Deployment</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <!-- The real-MySQL migration test is tagged @Tag("heavy-db"): it needs a real engine and
                 the right CPU arch, so the default `mvn test` excludes it here. The untagged
                 PostgreSQL tests still run by default. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <excludedGroups>${heavyDb.excludedGroups}</excludedGroups>
                    <groups>${heavyDb.includedGroups}</groups>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
