<?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>be.wegenenverkeer</groupId>
        <artifactId>atomium-client</artifactId>
        <version>4.0.0-RC2</version>
    </parent>

    <artifactId>atomium-client-spring-boot-4</artifactId>
    <name>${project.groupId}:${project.artifactId}</name>

    <!--
      Spring Boot 4 integration layer on top of atomium-client-{core,jackson-3,restclient}: discovers
      FeedHandler beans and sets up polling + pointer persistence + admin service on them (with minimal config).
      The application supplies the one environment-specific choice (which HTTP client and authentication to use) via a single
      FeedRestClientBuilders bean; content mapper, executor and backoff come as framework defaults.
      Package be.wegenenverkeer.atomium.client.springboot.

      This module is tied to Spring Boot 4 and manages the corresponding Boot, Spring, Jackson and test
      versions itself. For Spring Boot 3 a separate atomium-client-spring-boot-3 would exist alongside this module.
    -->
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>be.wegenenverkeer</groupId>
            <artifactId>atomium-client-core</artifactId>
            <version>${project.version}</version>
        </dependency>
        <!-- directly used Spring modules declared explicitly (versions via the Boot bom) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
        </dependency>

        <!-- the shared test support from core: recorders, feed page fixtures, TestFeedRuntimes -->
        <dependency>
            <groupId>be.wegenenverkeer</groupId>
            <artifactId>atomium-client-core</artifactId>
            <version>${project.version}</version>
            <type>test-jar</type>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>be.wegenenverkeer</groupId>
            <artifactId>atomium-client-jackson-3</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>be.wegenenverkeer</groupId>
            <artifactId>atomium-client-restclient</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>org.jspecify</groupId>
            <artifactId>jspecify</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>
        <!-- Micrometer for the feed metrics (MicrometerFeedEventListener); optional: only those who have a MeterRegistry
             (typically via actuator) get the metrics autoconfig. Those who don't want metrics don't drag in micrometer.
             The MicrometerFeedEventListener is Spring-free but (for now) deliberately not its own micro module. -->
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-core</artifactId>
            <optional>true</optional>
        </dependency>
        <!-- the health indicator; optional: only active when the app itself provides the Boot health API (actuator) -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-health</artifactId>
            <optional>true</optional>
        </dependency>
        <!-- the admin authorization seam (AccessDeniedException/SecurityContext); optional: only needed by those using the
             (web + enabled) endpoint, and they have Spring Security anyway. Not imposed transitively on feed consumers without admin. -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>tools.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <!-- JdbcClient for the feed pointer persistence (the app supplies the DataSource) -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
        </dependency>

        <!-- test -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- embedded servlet + MVC + security for the admin endpoint RestTest (RANDOM_PORT, real filter chain) -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.wiremock.integrations</groupId>
            <artifactId>wiremock-spring-boot</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- DataSource (HikariCP) + JdbcClient autoconfig for the DB integration tests -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jdbc</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- feed pointer repository IT against a real postgres via testcontainers (2.x artifact name) -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers-postgresql</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-database-postgresql</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <!-- keep parameter names: Spring MVC derives @PathVariable names on the admin endpoint from them -->
                    <parameters>true</parameters>
                    <!-- explicit: since JDK 23 javac no longer runs classpath processors implicitly -->
                    <annotationProcessorPaths>
                        <path>
                            <groupId>org.springframework.boot</groupId>
                            <artifactId>spring-boot-configuration-processor</artifactId>
                            <version>${spring-boot.version}</version>
                        </path>
                    </annotationProcessorPaths>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
