<?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>
    <!-- Project from https://start.vaadin.com/d0c53d62-e1db-4e7d-864a-018302d53ea6 -->

    <!--
        Aggregator / parent POM for the libraries (draiv, draiv-ai). It does
        NOT inherit spring-boot-starter-parent — only the todo-example does, because
        only the todo-example is an executable Spring Boot app. So this POM brings the
        Spring Boot dependency management in itself, via the
        spring-boot-dependencies BOM (import scope), and pins the few build
        plugins the libraries use. The todo-example is aggregated here for the
        reactor build but inherits spring-boot-starter-parent directly.
    -->
    <groupId>com.vaadin</groupId>
    <artifactId>draiv-parent</artifactId>
    <version>0.0.1-alpha1-SNAPSHOT</version>
    <packaging>pom</packaging>
    <name>Draiv parent</name>
    <description>Server-side automation for Vaadin Flow applications: drive components by script, recording or AI.</description>
    <url>https://github.com/vaadin/draiv-experiment</url>
    <licenses>
        <license>
            <name>Vaadin Commercial License and Service Terms</name>
            <url>https://vaadin.com/commercial-license-and-service-terms</url>
        </license>
    </licenses>
    <scm>
        <!--
            Used by the release plugin to tag. pushChanges is off (below), so
            release:prepare only commits and tags locally; the developer pushes
            with `git push` including the tag (see docs/internal/releasing.md), and .github/workflows/release.yml
            builds and deploys from the tag. See docs/internal/releasing.md.
        -->
        <connection>scm:git:https://github.com/vaadin/draiv-experiment.git</connection>
        <developerConnection>scm:git:git@github.com:vaadin/draiv-experiment.git</developerConnection>
        <url>https://github.com/vaadin/draiv-experiment</url>
        <tag>HEAD</tag>
    </scm>

    <modules>
        <!--
            Autonomous capability SPI (declares no <parent>); aggregated here
            only for build convenience. Destined to be lifted into the flow
            repository, so it must not depend on anything in this reactor.
        -->
        <module>flow-automation-commons</module>
        <module>flow-automation-components</module>
        <module>flow-automation-ai</module>
        <!-- Reusable tooling, in theory usable from other projects too. -->
        <module>draiv</module>
        <!-- Spring AI / OpenAI adapters layered over the core. -->
        <module>draiv-ai</module>
        <!-- The demo web application that exercises the libraries. -->
        <module>todo-example</module>
        <module>scheduled-macros</module>
        <!-- Second demo app: AI-assisted Grid search driving a query-builder form. -->
        <module>vaadin-grid-search-ui</module>
        <!--
            Third demo app, and the largest: Parempi, a spec-driven employee
            portal (~20 views, real Spring Security auth, JPA/H2) that exercises
            the whole stack — substrate, driver and AI layer — as a realistic
            application rather than a feature showcase. It is the test bed the
            findings in parempi/docs/upstream-feedback.md come from, so keeping
            it in the reactor means a library change is measured against a real
            app on every build.
        -->
        <module>parempi</module>
    </modules>

    <properties>
        <java.version>25</java.version>
        <maven.compiler.release>${java.version}</maven.compiler.release>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <!-- Must match the spring-boot-starter-parent version the todo-example uses. -->
        <spring-boot.version>4.1.1</spring-boot.version>
        <!--
            Keep in sync with the parentless modules that must declare their
            own Vaadin version: todo-example/ (inherits spring-boot-starter-parent),
            flow-automation-commons/ (flow.version), flow-automation-components/,
            and flow-automation-ai/. Inherited only by draiv/ and draiv-ai/.
        -->
        <vaadin.version>25.3.0-beta3</vaadin.version>
        <spring-ai.version>2.0.1</spring-ai.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!--
                vaadin-bom and spring-ai-bom are declared before
                spring-boot-dependencies so they win for any overlapping
                managed artifact (first-declared import wins), matching the old
                setup where these imports overrode the inherited Spring Boot
                management.
            -->
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-bom</artifactId>
                <version>${vaadin.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.ai</groupId>
                <artifactId>spring-ai-bom</artifactId>
                <version>${spring-ai.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!-- Spring Boot dependency management without inheriting its parent. -->
            <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>

    <build>
        <pluginManagement>
            <plugins>
                <!--
                    spring-boot-starter-parent normally pins these and wires the
                    compiler to the Java release; we are not inheriting it, so
                    pin them here for the library modules.
                -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.15.0</version>
                    <configuration>
                        <!--
                            spring-boot-starter-parent enables -parameters by
                            default; replicate it here so Spring AI can bind
                            tool-call JSON args to method parameter names
                            (e.g. @Tool methods in draiv-ai) and Spring can
                            resolve constructor/parameter names without
                            explicit annotations.
                        -->
                        <parameters>true</parameters>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>3.4.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.1.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <version>3.1.1</version>
                    <configuration>
                        <!-- v0.0.1-alpha1 — what .github/workflows/release.yml triggers on. -->
                        <tagNameFormat>v@{project.version}</tagNameFormat>
                        <!--
                            One version for the whole reactor, including the
                            parentless flow-automation-* modules and the example
                            apps, so a release is a single number.
                        -->
                        <autoVersionSubmodules>true</autoVersionSubmodules>
                        <!--
                            Commit and tag locally only. The developer reviews and
                            pushes, tag included; the CI release build
                            starts from the pushed tag.
                        -->
                        <pushChanges>false</pushChanges>
                        <scmCommentPrefix>[release] </scmCommentPrefix>
                        <!--
                            release:perform is not used — CI deploys from the tag —
                            so nothing here needs a release profile or a checkout.
                        -->
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <!-- Sources jars for the published libraries (draiv, draiv-ai inherit this). -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals><goal>jar-no-fork</goal></goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <repository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>vaadin-directory</id>
            <url>https://maven.vaadin.com/vaadin-addons</url>
        </repository>
        <repository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <!-- Central first to avoid unnecessary lookups from maven.vaadin.com for all artifacts -->
        <pluginRepository>
            <id>central</id>
            <url>https://repo.maven.apache.org/maven2</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>vaadin-prereleases</id>
            <url>https://maven.vaadin.com/vaadin-prereleases</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</project>
