<?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>ai.specformula</groupId>
        <artifactId>specformula</artifactId>
        <version>0.0.2</version>
    </parent>

    <artifactId>specformula-spring</artifactId>
    <packaging>jar</packaging>

    <name>SpecFormula Spring</name>
    <description>Spring Framework bridge for SpecFormula - auto-configures DataSource and MockMvc</description>

    <dependencies>
        <!-- SpecFormula Core -->
        <dependency>
            <groupId>ai.specformula</groupId>
            <artifactId>specformula-core</artifactId>
            <version>${project.version}</version>
        </dependency>

        <!-- Spring Context - for @Configuration, @Autowired -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>6.1.3</version>
            <scope>provided</scope>
        </dependency>

        <!-- Spring Test - for MockMvc -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>6.1.3</version>
            <scope>provided</scope>
        </dependency>

        <!-- Spring Web - HttpMethod（MockMvcHttpClientAdapter 使用） -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>6.1.3</version>
            <scope>provided</scope>
        </dependency>

        <!-- Servlet API - spring-test MockMvc 所需 -->
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <version>6.0.0</version>
            <scope>provided</scope>
        </dependency>

        <!-- Spring Boot Test - TestRestTemplate（optional，僅在使用者專案有 Spring Boot 時才生效） -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-test</artifactId>
            <version>3.2.2</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

        <!-- Apache HttpClient 5 - TestRestTemplateHttpClientAdapter 使用，
             取代 HttpURLConnection 避免 401 retry 問題（optional，僅 RestTemplate 模式需要） -->
        <dependency>
            <groupId>org.apache.httpcomponents.client5</groupId>
            <artifactId>httpclient5</artifactId>
            <version>5.3.1</version>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>

        <!-- Cucumber Spring - for component scanning in Cucumber context -->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-spring</artifactId>
            <scope>provided</scope>
        </dependency>

        <!-- Test dependencies -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <version>${junit-jupiter.version}</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
</project>
