<?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>com.vaadin</groupId>
        <artifactId>draiv-parent</artifactId>
        <version>0.0.1-alpha1-SNAPSHOT</version>
    </parent>

    <!--
        The draiv library — the project's reusable core: the headless
        UI-driving engine and serializable script model. Drives a live Vaadin
        UI from server-side code (locate / invoke / describe), records
        interactions, and replays scripts. Depends only on Vaadin + browserless
        + Spring (NOT Spring AI — that lives in a separate module so
        pure-automation consumers don't pull the AI stack).
        See docs/library-extraction-plan.md.
    -->
    <artifactId>draiv</artifactId>
    <packaging>jar</packaging>

    <dependencies>
        <!-- Vaadin Flow + components the driver/describe layer walks. -->
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin</artifactId>
        </dependency>
        <!-- @UIScope / Spring integration for the UI-scoped recorder etc. -->
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-spring-boot-starter</artifactId>
        </dependency>
        <!--
            Framework-agnostic capability SPI (Settable/Activatable/Selectable)
            the Driver dispatches through. Autonomous module, destined for Flow.
        -->
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>flow-automation-commons</artifactId>
            <version>0.0.1-alpha1-SNAPSHOT</version>
        </dependency>
        <!-- Pure-Flow CapabilityProviders for the standard Vaadin set, discovered
             via ServiceLoader by CapabilityRegistry.global(). Replaces draiv's own
             browserless-backed adapters. -->
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>flow-automation-components</artifactId>
            <version>0.0.1-alpha1-SNAPSHOT</version>
        </dependency>
        <!-- Script model (de)serialisation, incl. java.time (LocalDate). -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Spring-wired browserless bootstrap for the driver/script tests. -->
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>browserless-test-spring</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!--
                Publish the test fixtures (CoreTestApplication, the browserless
                bootstrap, and the @Route fixture views) as a test-jar so
                draiv-ai can reuse them for its cross-module contract test.
                Bound to process-test-classes (not the default package phase)
                so a plain `mvn test` reactor run produces it before draiv-ai
                compiles its tests.
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <executions>
                    <execution>
                        <id>fixtures-test-jar</id>
                        <phase>process-test-classes</phase>
                        <goals>
                            <goal>test-jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>
