<?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>

    <parent>
        <groupId>org.a2aproject.sdk</groupId>
        <artifactId>a2a-java-sdk-parent</artifactId>
        <version>1.0.0.Beta1</version>
        <relativePath>../../pom.xml</relativePath>
    </parent>

    <artifactId>a2a-java-sdk-reference-bom</artifactId>
    <packaging>pom</packaging>

    <name>A2A Java SDK - Reference Implementations BOM</name>
    <description>Bill of Materials (BOM) for A2A Java SDK reference implementations with Quarkus dependencies</description>

    <dependencyManagement>
        <dependencies>
            <!-- Import SDK BOM first -->
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>a2a-java-sdk-bom</artifactId>
                <version>${project.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- Import Quarkus BOM -->
            <dependency>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-bom</artifactId>
                <version>${quarkus.platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- Reference implementation modules -->
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>a2a-java-sdk-reference-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>a2a-java-sdk-reference-grpc</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>a2a-java-sdk-reference-jsonrpc</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>a2a-java-sdk-reference-rest</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- TCK module for testing reference implementations -->
            <dependency>
                <groupId>${project.groupId}</groupId>
                <artifactId>a2a-java-sdk-tck</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!-- Declare actual dependency on SDK BOM so Maven reactor understands build order -->
    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>a2a-java-sdk-bom</artifactId>
            <version>${project.version}</version>
            <type>pom</type>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-invoker-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                    <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
                    <settingsFile>src/it/settings.xml</settingsFile>
                    <goals>
                        <goal>clean</goal>
                        <goal>verify</goal>
                    </goals>
                    <streamLogs>false</streamLogs>
                    <streamLogsOnFailures>true</streamLogsOnFailures>
                    <invokerPropertiesFile>invoker.properties</invokerPropertiesFile>
                    <!-- Install test-utils module before running integration tests -->
                    <extraArtifacts>
                        <extraArtifact>org.a2aproject.sdk:a2a-java-bom-test-utils:${project.version}:jar</extraArtifact>
                    </extraArtifacts>
                </configuration>
                <executions>
                    <execution>
                        <id>integration-test</id>
                        <goals>
                            <goal>install</goal>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>
