<?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.55</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>

        <!-- 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 — 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: 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 because Quarkus 3.36.0 pins OTel-API 1.60.1
             while atmosphere-runtime resolves 1.62.0). 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>
    </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>
