<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns="http://maven.apache.org/POM/4.0.0"
         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.julien-dubois.bootui</groupId>
        <artifactId>bootui-parent</artifactId>
        <version>1.14.1</version>
    </parent>

    <artifactId>bootui-spring-autoconfigure</artifactId>
    <name>BootUI :: Spring Auto-Configuration</name>
    <description>Spring Boot 4 auto-configuration for the BootUI developer console.</description>

    <dependencies>
        <dependency>
            <groupId>com.julien-dubois.bootui</groupId>
            <artifactId>bootui-core</artifactId>
        </dependency>
        <dependency>
            <groupId>com.julien-dubois.bootui</groupId>
            <artifactId>bootui-engine</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>tools.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <optional>true</optional>
        </dependency>
        <!--
          Optional and compiled alongside spring-boot-starter-web (never both active in the same running
          app - Spring Boot picks one WebApplicationType at runtime). Needed to compile the reactive
          binding (BootUiReactiveAutoConfiguration and its WebFilter/WebFluxConfigurer ports) against
          org.springframework.web.reactive.* / ServerWebExchange types; consumers that only want the
          servlet adapter never see this on their classpath because it stays optional here too.
        -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-webflux</artifactId>
            <optional>true</optional>
        </dependency>
        <!--
          RestClientCustomizer/RestTemplateCustomizer (org.springframework.boot.restclient) and
          WebClientCustomizer (org.springframework.boot.webclient) each moved to their own Spring Boot 4
          module and are not transitively pulled in by spring-boot-starter-web/-webflux. Both are gated by
          @ConditionalOnClass nested configuration in BootUiAutoConfiguration for the REST Client
          panel, so they stay optional here too.
        -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-restclient</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-webclient</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-actuator-autoconfigure</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-health</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-commons</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>jakarta.persistence</groupId>
            <artifactId>jakarta.persistence-api</artifactId>
            <optional>true</optional>
        </dependency>
        <!--
          Hibernate ORM, optional (not transitive): needed solely to compile the Hibernate Session
          Monitoring panel (SpringHibernateStatisticsProvider), which unwraps the application's
          EntityManagerFactory to org.hibernate.SessionFactory and reads org.hibernate.stat.Statistics.
          optional=true keeps it out of a Hibernate-absent application's classpath; the provider class is
          only loaded (JVM class-loading, not just referenced) from within the
          @ConditionalOnClass(name = {"jakarta.persistence.EntityManagerFactory", "org.hibernate.SessionFactory"})
          HibernateAdvisorConfiguration nested class, so R2 (no optional-dependency classloading trap) holds.
        -->
        <dependency>
            <groupId>org.hibernate.orm</groupId>
            <artifactId>hibernate-core</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-jdbc</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-core</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.kafka</groupId>
            <artifactId>spring-kafka</artifactId>
            <!-- Explicit Spring Kafka 4.1 override aligned with the Spring Boot 4.1 / Spring
                 Framework 7 baseline. -->
            <version>4.1.0</version>
            <optional>true</optional>
        </dependency>
        <dependency>
            <!-- spring-jms: JmsTemplate and AbstractJmsListenerContainerFactory for the JMS
                 producer/consumer capture post-processors. Version is managed by the Spring Boot
                 parent BOM (org.springframework:spring-jms). Optional so it is not propagated to
                 applications; JmsBackendConfiguration's classpath gate handles safe absence. -->
            <groupId>org.springframework</groupId>
            <artifactId>spring-jms</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <!-- jakarta.jms-api: the JMS 3.1 API types (Queue, Topic, Message, etc.) used by
                 spring-jms. spring-jms declares this as a Gradle compileOnly dep but not in its
                 published Maven POM, so we must add it explicitly here. Version is managed by
                 the Spring Boot BOM. Optional so it is not propagated to applications. -->
            <groupId>jakarta.jms</groupId>
            <artifactId>jakarta.jms-api</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.amqp</groupId>
            <artifactId>spring-rabbit</artifactId>
            <!-- Optional: only compiled against and activated when spring-boot-starter-amqp
                 (which provides spring-rabbit) is on the classpath; the BPP beans are gated
                 on @ConditionalOnClass(RabbitTemplate) so they never wire in its absence. -->
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-core</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.tngtech.archunit</groupId>
            <artifactId>archunit</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.tngtech.archunit</groupId>
            <artifactId>archunit-junit5</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>io.opentelemetry.proto</groupId>
            <artifactId>opentelemetry-proto</artifactId>
            <version>${opentelemetry-proto.version}</version>
        </dependency>
        <dependency>
            <groupId>io.opentelemetry</groupId>
            <artifactId>opentelemetry-sdk-trace</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
        </dependency>
        <dependency>
            <groupId>com.julien-dubois.bootui</groupId>
            <artifactId>bootui-conformance</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.projectreactor</groupId>
            <artifactId>reactor-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-database-postgresql</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers-junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers-postgresql</artifactId>
            <scope>test</scope>
        </dependency>
        <!--
          Test-scope only: PostgresDatabaseAdvisorLiveTests and MariaDbDatabaseAdvisorLiveTests exercise the
          Database Advisor's vendor catalog augmentation against real servers, because partition/sequence
          ownership (PostgreSQL) and the information_schema column set (MySQL 8.0's IS_VISIBLE versus
          MariaDB 10.6's IGNORED) cannot be proven against a hand-built model. Both skip without Docker.
        -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers-mariadb</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.postgresql</groupId>
            <artifactId>postgresql</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mariadb.jdbc</groupId>
            <artifactId>mariadb-java-client</artifactId>
            <scope>test</scope>
        </dependency>
        <!--
          Test-scope only: OracleDatabaseAdvisorLiveTests exercises the Database Advisor's Oracle ALL_*
          catalog augmentation against a real 23ai (Oracle Database Free, a 19c+ superset) server, because
          index/constraint/sequence catalog shapes cannot be proven against a hand-built model. There is no
          production ojdbc dependency anywhere else in this project; the engine reads Oracle through plain
          java.sql.* against whatever Connection the host application's own datasource supplies. Skips
          without Docker.
        -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers-oracle-free</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.oracle.database.jdbc</groupId>
            <artifactId>ojdbc11</artifactId>
            <scope>test</scope>
        </dependency>

        <!--
          Test-scope only: LiveActivityControllerTests exercises the "Use the existing datasource"
          switch action's success path against a real, disposable database rather than mocking
          java.sql.*, mirroring bootui-engine's ActivitySwitchServiceTests/JdbcActivityStoreTests. H2's
          version is managed by the imported spring-boot-dependencies BOM.
        -->
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>test</scope>
        </dependency>
        <!--
          Test-scope only: CracRuntimeInventoryCollectorTests constructs a real RedisCacheManager (over a
          mocked RedisConnectionFactory, no live Redis needed) to verify the remote-backed cache manager
          exclusion (see CracRuntimeInventoryCollector.isRedisCacheManager). Version is managed by the
          Spring Boot BOM imported at the root pom.
        -->
        <dependency>
            <groupId>org.springframework.data</groupId>
            <artifactId>spring-data-redis</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <argLine>-javaagent:${org.mockito:mockito-core:jar}</argLine>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>macos-aarch64-netty-dns-tests</id>
            <activation>
                <os>
                    <family>mac</family>
                    <arch>aarch64</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>io.netty</groupId>
                    <artifactId>netty-resolver-dns-native-macos</artifactId>
                    <classifier>osx-aarch_64</classifier>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
        <profile>
            <id>macos-x86_64-netty-dns-tests</id>
            <activation>
                <os>
                    <family>mac</family>
                    <arch>x86_64</arch>
                </os>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>io.netty</groupId>
                    <artifactId>netty-resolver-dns-native-macos</artifactId>
                    <classifier>osx-x86_64</classifier>
                    <scope>test</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>
