<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
         xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <modelVersion>4.0.0</modelVersion>
    <groupId>ai.labs</groupId>
    <artifactId>eddi</artifactId>
    <version>6.1.0</version>
    <properties>
        <compiler-plugin.version>3.15.0</compiler-plugin.version>
        <maven.compiler.source>25</maven.compiler.source>
        <maven.compiler.target>25</maven.compiler.target>
        <maven.compiler.release>25</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <quarkus.microprofile.version>3.0.0.Final</quarkus.microprofile.version>
        <quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
        <quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
        <quarkus.platform.version>3.35.4</quarkus.platform.version>
        <langchain4j-beta.version>1.15.1-beta25</langchain4j-beta.version>
        <langchain4j.version>1.15.1</langchain4j.version>
        <langchain4j-libs.version>1.15.1</langchain4j-libs.version>
        <jandex-maven-plugin.version>3.5.3</jandex-maven-plugin.version>
        <maven.compiler.parameters>true</maven.compiler.parameters>
        <surefire-plugin.version>3.5.5</surefire-plugin.version>
        <failsafe-plugin.version>3.5.5</failsafe-plugin.version>
        <failsafe.useModulePath>false</failsafe.useModulePath>
        <war-plugin.version>3.4.0</war-plugin.version>
        <quarkus-mcp-server.version>1.12.1</quarkus-mcp-server.version>
        <langchain4j-community.version>1.15.0-beta25</langchain4j-community.version>
        <skipITs>true</skipITs>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>${quarkus.platform.artifact-id}</artifactId>
                <version>${quarkus.platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.github.classgraph</groupId>
                <artifactId>classgraph</artifactId>
                <version>4.8.184</version>
            </dependency>
            <!-- Override jinjava to fix CVE-2026-25526 (pulled by jlama-core via jlama) -->
            <dependency>
                <groupId>com.hubspot.jinjava</groupId>
                <artifactId>jinjava</artifactId>
                <version>2.8.3</version>
            </dependency>
            <!-- Override reactor-netty-http to fix CVE-2025-22227 (pulled by langchain4j-azure-open-ai) -->
            <dependency>
                <groupId>io.projectreactor.netty</groupId>
                <artifactId>reactor-netty-http</artifactId>
                <version>1.2.8</version>
            </dependency>
            <!-- Override postgresql to fix CVE-2026-42198 (client-side DoS via SCRAM iteration count).
                 Vulnerable: 42.2.0–42.7.10. Pulled by langchain4j-pgvector (42.7.7) and Quarkus BOM. -->
            <dependency>
                <groupId>org.postgresql</groupId>
                <artifactId>postgresql</artifactId>
                <version>42.7.11</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-container-image-docker</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-rest</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-rest-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-rest-client</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-rest-client-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-jackson</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-openapi</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-context-propagation</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-swagger-ui</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-arc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-scheduler</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-smallrye-health</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-micrometer-registry-prometheus</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-opentelemetry</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-oidc</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-keycloak-authorization</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-cache</artifactId>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j</artifactId>
            <version>${langchain4j.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-open-ai</artifactId>
            <version>${langchain4j-libs.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-anthropic</artifactId>
            <version>${langchain4j-libs.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-ollama</artifactId>
            <version>${langchain4j-libs.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-vertex-ai-gemini</artifactId>
            <version>${langchain4j-beta.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-hugging-face</artifactId>
            <version>${langchain4j-beta.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-google-ai-gemini</artifactId>
            <version>${langchain4j-libs.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-http-client-jdk</artifactId>
            <version>${langchain4j-libs.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-jlama</artifactId>
            <version>${langchain4j-beta.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-mcp</artifactId>
            <version>${langchain4j-beta.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-agentic-a2a</artifactId>
            <version>${langchain4j-beta.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-pgvector</artifactId>
            <version>${langchain4j-beta.version}</version>
        </dependency>
        <!-- LLM Provider Expansion: Mistral AI, Azure OpenAI, Amazon Bedrock, Oracle GenAI -->
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-mistral-ai</artifactId>
            <version>${langchain4j-libs.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-azure-open-ai</artifactId>
            <version>${langchain4j-libs.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-bedrock</artifactId>
            <version>${langchain4j-libs.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-community-oci-genai</artifactId>
            <version>${langchain4j-community.version}</version>
        </dependency>
        <!-- RAG Provider Expansion: additional embedding stores + models -->
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-mongodb-atlas</artifactId>
            <version>${langchain4j-beta.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-elasticsearch</artifactId>
            <version>${langchain4j-beta.version}</version>
            <exclusions>
                <!-- Exclude Jackson 3.x (tools.jackson namespace) to fix WS-2026-0003 / CVE-2026-29062.
                     Elasticsearch-java 9.x pulls jackson-core 3.0.0 which has a High-severity vuln.
                     The rest of EDDI uses com.fasterxml.jackson (2.x) managed by Quarkus BOM. -->
                <exclusion>
                    <groupId>tools.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>tools.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>tools.jackson.core</groupId>
                    <artifactId>jackson-annotations</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-qdrant</artifactId>
            <version>${langchain4j-beta.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-chroma</artifactId>
            <version>${langchain4j-beta.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-cohere</artifactId>
            <version>${langchain4j-beta.version}</version>
        </dependency>
        <dependency>
            <groupId>dev.langchain4j</groupId>
            <artifactId>langchain4j-vertex-ai</artifactId>
            <version>${langchain4j-beta.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox</artifactId>
            <version>3.0.7</version>
        </dependency>
        <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>1.22.2</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-csv</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.dataformat</groupId>
            <artifactId>jackson-dataformat-xml</artifactId>
        </dependency>

        <dependency>
            <groupId>io.swagger.core.v3</groupId>
            <artifactId>swagger-annotations</artifactId>
            <version>2.2.50</version>
        </dependency>
        <dependency>
            <groupId>de.undercouch</groupId>
            <artifactId>bson4jackson</artifactId>
            <version>2.15.1</version>
            <exclusions>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-annotations</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>com.fasterxml.jackson.core</groupId>
                    <artifactId>jackson-databind</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.github.victools</groupId>
            <artifactId>jsonschema-generator</artifactId>
            <version>4.38.0</version>
        </dependency>
        <dependency>
            <groupId>com.github.victools</groupId>
            <artifactId>jsonschema-module-jackson</artifactId>
            <version>4.38.0</version>
        </dependency>
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-mongodb-client</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.20.0</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.jayway.jsonpath</groupId>
            <artifactId>json-path</artifactId>
            <version>2.10.0</version>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-qute</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-vertx</artifactId>
        </dependency>
        <dependency>
            <groupId>io.vertx</groupId>
            <artifactId>vertx-web-client</artifactId>
        </dependency>
        <dependency>
            <groupId>jakarta.transaction</groupId>
            <artifactId>jakarta.transaction-api</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- quarkus-jacoco: Quarkus-native JaCoCo instrumentation for @QuarkusTest ITs.
             Writes coverage data from within the Quarkus classloader, avoiding the
             Windows agent path quoting issue that breaks the standard JaCoCo agent approach. -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-jacoco</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.rest-assured</groupId>
            <artifactId>rest-assured</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Mozilla Rhino: JavaScript engine for CalculatorTool tests -->
        <!-- Pure Java implementation, works in all environments, auto-registers with ScriptEngineManager -->
        <dependency>
            <groupId>org.mozilla</groupId>
            <artifactId>rhino-engine</artifactId>
            <version>1.9.1</version>
            <scope>test</scope>
        </dependency>
        <!-- WireMock: embedded HTTP mock server for LlmTask and ApiCallsTask integration tests -->
        <dependency>
            <groupId>org.wiremock</groupId>
            <artifactId>wiremock-standalone</artifactId>
            <version>3.13.2</version>
            <scope>test</scope>
        </dependency>
        <!-- Jazzer: coverage-guided fuzz testing for security-critical parsers -->
        <dependency>
            <groupId>com.code-intelligence</groupId>
            <artifactId>jazzer-junit</artifactId>
            <version>0.30.0</version>
            <scope>test</scope>
        </dependency>
        <!-- Testcontainers: container-based integration testing for E2E agent tests -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
            <version>1.21.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>1.21.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>mongodb</artifactId>
            <version>1.21.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>postgresql</artifactId>
            <version>1.21.4</version>
            <scope>test</scope>
        </dependency>
        <!-- NATS JetStream client for async conversation processing (Phase 5) -->
        <dependency>
            <groupId>io.nats</groupId>
            <artifactId>jnats</artifactId>
            <version>2.25.3</version>
        </dependency>
        <!-- PostgreSQL JDBC driver + Agroal connection pool (Phase 6.31) -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-jdbc-postgresql</artifactId>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-agroal</artifactId>
        </dependency>
        <!-- Phase 8a: Quarkus MCP Server — expose EDDI as MCP tool provider -->
        <dependency>
            <groupId>io.quarkiverse.mcp</groupId>
            <artifactId>quarkus-mcp-server-http</artifactId>
            <version>${quarkus-mcp-server.version}</version>
        </dependency>
        <!-- Phase 8a+: OpenAPI spec parser for create_api_agent MCP tool -->
        <dependency>
            <groupId>io.swagger.parser.v3</groupId>
            <artifactId>swagger-parser</artifactId>
            <version>2.1.42</version>
        </dependency>

    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>io.smallrye</groupId>
                <artifactId>jandex-maven-plugin</artifactId>
                <version>${jandex-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>make-index</id>
                        <goals>
                            <goal>jandex</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <version>${quarkus.platform.version}</version>
                <extensions>true</extensions>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                            <goal>generate-code</goal>
                            <goal>generate-code-tests</goal>
                            <goal>native-image-agent</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>${compiler-plugin.version}</version>
                <configuration>
                    <compilerArgs>
                        <arg>-parameters</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
            <!-- Enforcer: ban Jackson 3.x (tools.jackson.*) from the dependency tree.
                 Prevents silent re-introduction via transitive dependencies (e.g. Elasticsearch). -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.6.3</version>
                <executions>
                    <execution>
                        <id>ban-jackson3</id>
                        <goals><goal>enforce</goal></goals>
                        <configuration>
                            <rules>
                                <bannedDependencies>
                                    <excludes>
                                        <exclude>tools.jackson.core:*</exclude>
                                    </excludes>
                                    <message>Jackson 3.x (tools.jackson.*) is banned — use com.fasterxml.jackson (2.x) managed by Quarkus BOM.</message>
                                </bannedDependencies>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${surefire-plugin.version}</version>
                <configuration>
                    <!-- @{argLine} preserves JaCoCo's injected agent arg -->
                    <argLine>@{argLine} -ea -XX:+EnableDynamicAgentLoading -Xshare:off --enable-native-access=ALL-UNNAMED</argLine>
                    <excludes>
                        <exclude>**/*IT.java</exclude>
                    </excludes>
                    <systemPropertyVariables>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        <java.util.logging.config.file>${project.basedir}/src/test/resources/logging.properties</java.util.logging.config.file>
                        <!--suppress UnresolvedMavenProperty -->
                        <maven.home>${maven.home}</maven.home>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${surefire-plugin.version}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <includes>
                        <include>**/*IT.java</include>
                    </includes>
                    <!-- NOTE: @{argLine} for JaCoCo IT instrumentation is intentionally NOT added here.
                         On Windows, the JaCoCo agent path with backslashes breaks the Quarkus
                         FacadeClassLoader. CI (Linux) uses the quarkus-jacoco extension instead.
                         See ContainerBaseIT.java line 24 for details. -->
                    <!-- Kill the forked test process if it hasn't completed in 15 minutes.
                         Prevents CI from hanging indefinitely when Docker image builds
                         or container startup fails to propagate errors. -->
                    <forkedProcessTimeoutInSeconds>900</forkedProcessTimeoutInSeconds>
                    <!-- Retry container-startup failures once. Testcontainers ITs
                         can flake on CI runners due to Docker networking timing.
                         This gives one automatic retry before failing the build. -->
                    <rerunFailingTestsCount>1</rerunFailingTestsCount>
                    <systemPropertyVariables>
                        <native.image.path>${project.build.directory}/${project.build.finalName}-runner
                        </native.image.path>
                        <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                        <!--suppress UnresolvedMavenProperty -->
                        <maven.home>${maven.home}</maven.home>
                    </systemPropertyVariables>
                </configuration>
            </plugin>
            <!-- Checkstyle: code style enforcement (warnings only) -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.6.0</version>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>false</failsOnError>
                    <failOnViolation>false</failOnViolation>
                    <violationSeverity>warning</violationSeverity>
                    <linkXRef>false</linkXRef>
                </configuration>
                <executions>
                    <execution>
                        <?m2e ignore?>
                        <id>validate</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- Code Formatter -->
            <plugin>
                <groupId>net.revelc.code.formatter</groupId>
                <artifactId>formatter-maven-plugin</artifactId>
                <version>2.29.0</version>
                <configuration>
                    <configFile>${project.basedir}/eclipse-formatter.xml</configFile>
                    <lineEnding>KEEP</lineEnding>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>format</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- JaCoCo: code coverage reporting -->
            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>0.8.14</version>
                <!-- Plugin-level excludes: applied to report AND check goals.
                     Excludes CDI bootstrap wiring, external integration adapters,
                     REST client libraries, and import/export services that require
                     a running Quarkus container (@QuarkusTest ITs cover these). -->
                <configuration>
                    <excludes>
                        <!-- CDI bootstrap producers: @Produces methods that wire beans,
                             zero business logic, verified by container startup in @QuarkusTest ITs -->
                        <exclude>**/bootstrap/**</exclude>
                        <!-- Generated REST client wrappers (no logic, just JAX-RS proxy interfaces) -->
                        <exclude>**/runtime/client/**</exclude>
                        <!-- LLM provider SDK factory builders: each wraps a single external SDK
                             constructor call (e.g., OpenAI, Anthropic, Bedrock). No business logic,
                             cannot be tested without live API keys. -->
                        <exclude>**/llm/impl/builder/**</exclude>
                        <!-- Slack integration adapter: requires live Slack webhook API,
                             not testable without external service -->
                        <exclude>**/integrations/slack/**</exclude>
                    </excludes>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>report</id>
                        <phase>test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                    </execution>

                    <!-- Instrument integration tests (Failsafe) -->
                    <execution>
                        <id>prepare-agent-integration</id>
                        <goals>
                            <goal>prepare-agent-integration</goal>
                        </goals>
                    </execution>
                    <!-- Merge IT-only data: failsafe agent + quarkus-jacoco extension.
                         @QuarkusTest ITs write to jacoco-quarkus.exec (not jacoco-it.exec),
                         so we merge both to get a complete IT-only picture. -->
                    <execution>
                        <id>merge-it</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>merge</goal>
                        </goals>
                        <configuration>
                            <fileSets>
                                <fileSet>
                                    <directory>${project.build.directory}</directory>
                                    <includes>
                                        <include>jacoco-it.exec</include>
                                        <include>jacoco-quarkus.exec</include>
                                    </includes>
                                </fileSet>
                            </fileSets>
                            <destFile>${project.build.directory}/jacoco-it-all.exec</destFile>
                        </configuration>
                    </execution>
                    <execution>
                        <id>report-integration</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <dataFile>${project.build.directory}/jacoco-it-all.exec</dataFile>
                            <outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
                        </configuration>
                    </execution>
                    <!-- Merge UT + IT data files for combined coverage -->
                    <execution>
                        <id>merge</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>merge</goal>
                        </goals>
                        <configuration>
                            <fileSets>
                                <fileSet>
                                    <directory>${project.build.directory}</directory>
                                    <includes>
                                        <include>jacoco.exec</include>
                                        <include>jacoco-it.exec</include>
                                        <include>jacoco-quarkus.exec</include>
                                    </includes>
                                </fileSet>
                            </fileSets>
                            <destFile>${project.build.directory}/jacoco-merged.exec</destFile>
                        </configuration>
                    </execution>
                    <execution>
                        <id>merged-report</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <dataFile>${project.build.directory}/jacoco-merged.exec</dataFile>
                            <outputDirectory>${project.reporting.outputDirectory}/jacoco-merged</outputDirectory>
                        </configuration>
                    </execution>
                    <!-- Coverage gate (merged UT+IT): the single authoritative threshold.
                         Enforced during `mvn verify` against combined unit + integration test data.
                         Target: 80/70 for OpenSSF Silver. -->
                    <execution>
                        <id>merged-check</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                        <configuration>
                            <dataFile>${project.build.directory}/jacoco-merged.exec</dataFile>
                            <rules>
                                <rule>
                                    <element>BUNDLE</element>
                                    <limits>
                                        <limit>
                                            <counter>INSTRUCTION</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.70</minimum>
                                        </limit>
                                        <limit>
                                            <counter>BRANCH</counter>
                                            <value>COVEREDRATIO</value>
                                            <minimum>0.60</minimum>
                                        </limit>
                                    </limits>
                                </rule>
                            </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <profiles>
        <profile>
            <id>native</id>
            <activation>
                <property>
                    <name>native</name>
                </property>
            </activation>
            <properties>
                <skipITs>false</skipITs>
                <quarkus.package.type>native</quarkus.package.type>
            </properties>
        </profile>
        <!-- Red Hat Certification: generate third-party license info.
             Activate with: mvn package -Plicense-gen
             Only needed before Docker builds / certification submissions. -->
        <profile>
            <id>license-gen</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>license-maven-plugin</artifactId>
                        <version>2.7.1</version>
                        <executions>
                            <!-- Generate THIRD-PARTY.txt listing all deps + their licenses -->
                            <execution>
                                <id>generate-third-party</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>add-third-party</goal>
                                </goals>
                                <configuration>
                                    <outputDirectory>${project.basedir}/licenses</outputDirectory>
                                    <thirdPartyFilename>THIRD-PARTY.txt</thirdPartyFilename>
                                    <excludedScopes>test</excludedScopes>
                                    <failOnMissing>false</failOnMissing>
                                    <sortArtifactByName>true</sortArtifactByName>
                                    <useMissingFile>true</useMissingFile>
                                    <missingFile>${project.basedir}/src/license/THIRD-PARTY.properties
                                    </missingFile>
                                </configuration>
                            </execution>
                            <!-- Download actual license text files for each dependency -->
                            <execution>
                                <id>download-licenses</id>
                                <phase>generate-resources</phase>
                                <goals>
                                    <goal>download-licenses</goal>
                                </goals>
                                <configuration>
                                    <licensesOutputDirectory>${project.basedir}/licenses/third-party
                                    </licensesOutputDirectory>
                                    <licensesOutputFile>${project.basedir}/licenses/licenses.xml
                                    </licensesOutputFile>
                                    <excludedScopes>test</excludedScopes>
                                    <!-- GNU.org blocks automated downloads — use mirrors -->
                                    <licenseUrlReplacements>
                                        <licenseUrlReplacement>
                                            <regexp>http://www\.gnu\.org/licenses/lgpl\.html</regexp>
                                            <replacement>https://spdx.org/licenses/LGPL-3.0-or-later.html
                                            </replacement>
                                        </licenseUrlReplacement>
                                        <licenseUrlReplacement>
                                            <regexp>http://www\.gnu\.org/licenses/lgpl-2\.1\.html</regexp>
                                            <replacement>https://spdx.org/licenses/LGPL-2.1-only.html
                                            </replacement>
                                        </licenseUrlReplacement>
                                        <licenseUrlReplacement>
                                            <regexp>https://www\.gnu\.org/software/classpath/license\.html
                                            </regexp>
                                            <replacement>https://openjdk.org/legal/gplv2+ce.html</replacement>
                                        </licenseUrlReplacement>
                                        <licenseUrlReplacement>
                                            <regexp>http://www\.gnu\.org/licenses/licenses\.html</regexp>
                                            <replacement>https://spdx.org/licenses/GPL-2.0-only.html
                                            </replacement>
                                        </licenseUrlReplacement>
                                    </licenseUrlReplacements>
                                    <!-- Don't fail on remaining download errors -->
                                    <errorRemedy>ignore</errorRemedy>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
