<?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/maven-v4_0_0.xsd">
    <parent>
        <groupId>org.atmosphere</groupId>
        <artifactId>atmosphere-quarkus-extension-parent</artifactId>
        <version>4.0.77</version>
    </parent>

    <modelVersion>4.0.0</modelVersion>
    <artifactId>atmosphere-quarkus-extension-deployment</artifactId>
    <packaging>jar</packaging>
    <name>atmosphere-quarkus-extension-deployment</name>
    <description>Quarkus extension for Atmosphere Framework - Deployment</description>
    <url>https://github.com/Atmosphere/atmosphere</url>

    <dependencies>
        <dependency>
            <groupId>org.atmosphere</groupId>
            <artifactId>atmosphere-quarkus-extension</artifactId>
        </dependency>

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc-deployment</artifactId>
        </dependency>

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-undertow-deployment</artifactId>
        </dependency>

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-websockets-client-deployment</artifactId>
        </dependency>

        <!-- Annotation-only: RouteBuildItem's Vert.x Handler API carries
             io.vertx.codegen annotations; without the jar javac -Xlint:classfile
             warns (and -Werror fails). -->
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-codegen</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Deployment-side SPI for the smallrye-health build step. NOT
             optional: Quarkus's ExtensionLoader resolves every @BuildStep
             class in the deployment jar at extension-load time and reads
             the method signatures to discover BuildItem types. The
             registerHealthCheck step's signature references
             HealthBuildItem, so the SPI must be on the build-time
             classpath of every downstream Quarkus extension that
             transitively depends on atmosphere-quarkus-extension-deployment
             (e.g. atmosphere-quarkus-grpc-deployment). Capability.SMALLRYE_HEALTH
             gating handles the runtime side. -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-health-spi</artifactId>
        </dependency>

        <!-- Override parent's SLF4J 1.x with Quarkus-compatible version -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>2.0.17</version>
        </dependency>

        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit-internal</artifactId>
            <scope>test</scope>
        </dependency>

        <!--
            Test-scope only — the runtime extension does NOT depend on
            atmosphere-ai, but we need the governance classes on the test
            classpath to run the v4 Phase A Quarkus-parity test that proves
            governance admission behaves identically on Quarkus and
            Spring Boot.
        -->
        <dependency>
            <groupId>org.atmosphere</groupId>
            <artifactId>atmosphere-ai</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <!--
            Test-scope only — proves the durable-runs @BuildStep engages the
            bundled crash-durable SQLite journal on Quarkus (Spring Boot parity
            for DurableRunSpineInstaller). Brings SqliteEffectJournal and its
            transitive sqlite-jdbc driver onto the test classpath so
            AtmosphereDurableRunsProducer resolves the SQLite journal rather than
            the in-memory fallback.
        -->
        <dependency>
            <groupId>org.atmosphere</groupId>
            <artifactId>atmosphere-checkpoint</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <!--
            Test-scope only — checkpoint declares sqlite-jdbc OPTIONAL (so it does
            not transit), and DriverManager needs the driver on the same classloader
            as SqliteEffectJournal. A real Quarkus app enabling journal=sqlite adds
            the driver the same way; absent it, AtmosphereDurableRunsProducer logs a
            NOT-crash-durable warning and falls back to in-memory (Invariant #5).
        -->
        <dependency>
            <groupId>org.xerial</groupId>
            <artifactId>sqlite-jdbc</artifactId>
            <version>3.53.2.0</version>
            <scope>test</scope>
        </dependency>

        <!--
            Test-scope only — the runtime extension does NOT depend on
            atmosphere-mcp / atmosphere-agent (MCP is opt-in on Quarkus, same as
            elsewhere). They are forced onto a single test's app classpath via
            setForcedDependencies(...) to prove @Agent-based MCP registration and
            OAuth resource-server authorization work on Quarkus. agent declares
            mcp OPTIONAL (it links MCP types reflectively), so mcp is declared
            explicitly for the test's @McpTool/@McpParam compile.
        -->
        <dependency>
            <groupId>org.atmosphere</groupId>
            <artifactId>atmosphere-agent</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.atmosphere</groupId>
            <artifactId>atmosphere-mcp</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <!--
            Test-scope only — the runtime extension does NOT depend on
            atmosphere-coordinator (fleets are opt-in on Quarkus, same as
            elsewhere). It is forced onto a single test's app classpath via
            setForcedDependencies(...) to prove @Coordinator registration works
            on Quarkus (mode parity with Spring Boot / plain servlet).
            coordinator declares a2a OPTIONAL, but LocalAgentTransport's
            fleet dispatch resolves handlers through a2a's LocalDispatchable
            seam, so a2a is part of the supported fleet topology (both
            coordinator samples declare it) and is forced alongside.
        -->
        <dependency>
            <groupId>org.atmosphere</groupId>
            <artifactId>atmosphere-coordinator</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.atmosphere</groupId>
            <artifactId>atmosphere-a2a</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Test-scope: the observability build-step tests pull these in
             via setForcedDependencies on the per-test QuarkusExtensionTest
             instance rather than relying on the flat reactor classpath
             (which previously caused Prometheus' OpenTelemetry exemplar
             sampler to crash when the Quarkus BOM's OTel baseline and the
             opentelemetry-api version atmosphere-runtime resolves diverged —
             1.60.1 vs 1.62.0 on Quarkus 3.36.x). The dependencies
             stay declared here so Maven downloads them; test code uses
             setForcedDependencies(...) to scope them to a single test
             rather than the reactor classpath. -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-health-deployment</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-micrometer-deployment</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Test-scope: embedded-users HTTP security for the Vert.x container
             tests, forced per test via setForcedDependencies(...) so the other
             deployment tests keep running without a security extension. -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-elytron-security-properties-file-deployment</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <annotationProcessorPaths>
                        <path>
                            <groupId>io.quarkus</groupId>
                            <artifactId>quarkus-extension-processor</artifactId>
                            <version>${quarkus.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <systemPropertyVariables>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        <!-- Exposes the reactor version to setForcedDependencies(...) in
                             the MCP-on-Quarkus auth test so it forces the right SNAPSHOT. -->
                        <atmosphere.project.version>${project.version}</atmosphere.project.version>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
