<?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>io.github.a2asdk</groupId>
        <artifactId>a2a-java-queue-manager-replicated-parent</artifactId>
        <version>1.0.0.Alpha1</version>
        <relativePath>../pom.xml</relativePath>
    </parent>

    <artifactId>a2a-java-queue-manager-replicated-tests-single-instance</artifactId>
    <name>Java A2A Extras: Replicated Queue Manager Tests - Single Instance</name>

    <dependencies>
        <!-- Project Modules -->
        <dependency>
            <groupId>io.github.a2asdk</groupId>
            <artifactId>a2a-java-queue-manager-replicated-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>io.github.a2asdk</groupId>
            <artifactId>a2a-java-queue-manager-replication-mp-reactive</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>io.github.a2asdk</groupId>
            <artifactId>a2a-java-sdk-jsonrpc-common</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- A2A Reference Impl for a runnable app -->
        <dependency>
            <groupId>io.github.a2asdk</groupId>
            <artifactId>a2a-java-sdk-reference-jsonrpc</artifactId>
        </dependency>

        <!-- JPA TaskStore for testing poison pill generation -->
        <dependency>
            <groupId>io.github.a2asdk</groupId>
            <artifactId>a2a-java-extras-task-store-database-jpa</artifactId>
            <version>${project.version}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-jdbc-h2</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-hibernate-orm</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- A2A Client for testing -->
        <dependency>
            <groupId>io.github.a2asdk</groupId>
            <artifactId>a2a-java-sdk-client</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.github.a2asdk</groupId>
            <artifactId>a2a-java-sdk-transport-jsonrpc</artifactId>
            <scope>test</scope>
        </dependency>

        <!-- Quarkus Testing -->
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-junit5</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-messaging-kafka</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <profiles>
        <profile>
            <id>java24-exclude-vertx-incompatible-tests</id>
            <activation>
                <jdk>[24,)</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
                            <excludes>
                                <!-- TODO: Remove this profile when Quarkus is updated to a version using Vert.x 4.6.0+.
                                     These tests are excluded on Java 24+ due to a Vert.x ServiceLoader incompatibility with Quarkus streaming.
                                     Current Quarkus versions (e.g., 3.28.x) use Vert.x 4.5.x, which is not fully compatible with Java 24+. -->
                                <exclude>**/KafkaReplicationIntegrationTest.java</exclude>
                            </excludes>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <plugins>
            <plugin>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>