<?xml version="1.0" encoding="UTF-8"?>
<!--
  apicurio-client — dual schema-registry client abstraction (ADR-0011 §B).

  Public API:
    - SchemaRegistryClient                       (interface, Kind + WireFormat + Schema record)
    - ApicurioSchemaRegistryClient               (impl, primary, 8-byte globalId wire prefix)
    - ConfluentWireCompatSchemaRegistryClient    (impl, Apicurio backend, 4-byte schemaId wire prefix)
    - DualSchemaRegistryClient                   (coordinator, primary + fallback)
    - WireFormat (enum) / WireFormatCodec / WireFormatException
    - SchemaRegistryProperties (@ConfigurationProperties("im2be.schema-registry"))
    - SchemaRegistryAutoConfiguration

  Apicurio 2.5.11.Final pinned in the parent pom (rule 9). OpenTelemetry 1.49.0
  and Testcontainers 1.21.4 are managed by Spring Boot 3.5.14 BOM — declared
  here WITHOUT <version> to inherit the BOM (rule 10).

  Cross-refs: ADR-0011 §B (primary SR + wire-format hedge), ADR-0014 D-3.
-->
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.aim2be</groupId>
        <artifactId>im2be-platform-libs-parent</artifactId>
        <version>1.1.0-SNAPSHOT</version>
    </parent>

    <artifactId>apicurio-client</artifactId>
    <packaging>jar</packaging>
    <name>im2be-platform-libs :: apicurio-client</name>
    <description>Apicurio (primary) / Confluent (wire-format hedge) schema registry client (ADR-0011 §B).</description>

    <dependencies>
        <!-- Apicurio Registry REST client (v2 API) -->
        <dependency>
            <groupId>io.apicurio</groupId>
            <artifactId>apicurio-registry-client</artifactId>
            <version>${apicurio.client.version}</version>
        </dependency>

        <!-- Spring Boot autoconfig + @ConfigurationProperties binding.
             We deliberately DO NOT depend on spring-boot-starter — it brings
             logback + jakarta-annotation transitively, which forces logging
             choices onto consumers (R5 MINOR fix). Each consuming service
             ships its own starter (-web, -webflux, etc.) plus a logging
             implementation; the autoconfig only needs the non-bundled bits. -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </dependency>

        <!-- Generates spring-configuration-metadata.json for IDE auto-complete
             on the im2be.schema-registry.* properties (rule 7). -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- OpenTelemetry tracing API (managed by Spring Boot BOM at 1.49.0).
             Compile scope — every consuming service already runs OTel for
             tracing; making it transitive ensures the client's spans always
             have a Tracer to attach to (autoconfig falls back to noop). -->
        <dependency>
            <groupId>io.opentelemetry</groupId>
            <artifactId>opentelemetry-api</artifactId>
        </dependency>

        <!-- Test deps -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.opentelemetry</groupId>
            <artifactId>opentelemetry-sdk-testing</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Integration test execution: ApicurioIT runs under failsafe.
                 Verify phase wires container-backed tests; surefire stays
                 focused on unit tests. -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
