<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>dev.dokimos</groupId>
    <artifactId>dokimos-parent</artifactId>
    <version>0.23.0</version>
    <packaging>pom</packaging>

    <name>Dokimos :: Parent POM</name>
    <description>Evaluation Framework for LLM applications in Java</description>
    <url>https://github.com/dokimos-dev/dokimos/tree/master</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>https://opensource.org/license/MIT</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <id>fkapsahili</id>
            <name>Fabio Kapsahili</name>
            <email>info@dokimos.dev</email>
            <url>https://github.com/fkapsahili</url>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/dokimos-dev/dokimos.git</connection>
        <developerConnection>scm:git:git@github.com:dokimos-dev/dokimos.git</developerConnection>
        <url>https://github.com/dokimos-dev/dokimos/tree/master</url>
    </scm>

    <modules>
        <module>dokimos-core</module>
        <module>dokimos-junit</module>
        <module>dokimos-langchain4j</module>
        <module>dokimos-spring-ai</module>
        <module>dokimos-spring-ai-alibaba</module>
        <module>dokimos-koog</module>
        <module>dokimos-kotlin</module>
        <module>dokimos-server-client</module>
        <module>dokimos-server</module>
        <module>dokimos-examples</module>
        <module>dokimos-mcp-server</module>
    </modules>

    <properties>
        <java.version>17</java.version>
        <maven.compiler.release>${java.version}</maven.compiler.release>
        <maven.compiler.parameters>true</maven.compiler.parameters>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <junit.version>6.0.1</junit.version>
        <junit.platform.version>6.0.1</junit.platform.version>
        <spotless.version>3.2.1</spotless.version>
        <palantir.version>2.86.0</palantir.version>
        <ktlint.version>1.5.0</ktlint.version>
        <!-- Matches the reactor-core managed by Spring Boot 3.5.10 (reactor-bom 2024.0.14). -->
        <reactor.version>3.7.15</reactor.version>
        <embabel.version>0.4.0</embabel.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Spring Boot BOM -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>3.5.10</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-api</artifactId>
                <version>${junit.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${junit.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-commons</artifactId>
                <version>${junit.platform.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-engine</artifactId>
                <version>${junit.platform.version}</version>
            </dependency>
            <dependency>
                <groupId>org.junit.platform</groupId>
                <artifactId>junit-platform-launcher</artifactId>
                <version>${junit.platform.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>3.27.7</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.openai</groupId>
                <artifactId>openai-java</artifactId>
                <version>4.11.0</version>
            </dependency>
            <!-- Kotlin-aware Jackson module, pinned to the same Jackson version dokimos-core uses. -->
            <dependency>
                <groupId>com.fasterxml.jackson.module</groupId>
                <artifactId>jackson-module-kotlin</artifactId>
                <version>2.18.2</version>
            </dependency>
            <dependency>
                <groupId>org.mockito</groupId>
                <artifactId>mockito-junit-jupiter</artifactId>
                <version>5.21.0</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>2.0.16</version>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>testcontainers-bom</artifactId>
                <version>1.20.6</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.opentelemetry.proto</groupId>
                <artifactId>opentelemetry-proto</artifactId>
                <version>1.7.0-alpha</version>
            </dependency>
            <!-- Reactor for the Spring AI reactive task adapter (provided scope in dokimos-spring-ai). -->
            <dependency>
                <groupId>io.projectreactor</groupId>
                <artifactId>reactor-core</artifactId>
                <version>${reactor.version}</version>
            </dependency>
            <!-- Embabel agent API (provided scope in dokimos-embabel). Genuinely new to the repo,
                 so the version is managed here; Spring AI / Alibaba stay module-local (house exception). -->
            <dependency>
                <groupId>com.embabel.agent</groupId>
                <artifactId>embabel-agent-api</artifactId>
                <version>${embabel.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <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-resources-plugin</artifactId>
                    <version>3.3.1</version>
                </plugin>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <version>3.5.10</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.2.8</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>3.5.4</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>0.9.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.5.4</version>
                    <configuration>
                        <excludedGroups>integration</excludedGroups>
                        <argLine>-XX:+EnableDynamicAgentLoading -Xshare:off</argLine>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>com.diffplug.spotless</groupId>
                    <artifactId>spotless-maven-plugin</artifactId>
                    <version>${spotless.version}</version>
                    <configuration>
                        <java>
                            <palantirJavaFormat>
                                <version>${palantir.version}</version>
                                <style>PALANTIR</style>
                            </palantirJavaFormat>
                            <removeUnusedImports/>
                            <importOrder/>
                        </java>
                        <kotlin>
                            <includes>
                                <include>src/main/kotlin/**/*.kt</include>
                                <include>src/test/kotlin/**/*.kt</include>
                            </includes>
                            <ktlint>
                                <version>${ktlint.version}</version>
                                <editorConfigOverride>
                                    <ktlint_code_style>intellij_idea</ktlint_code_style>
                                    <ktlint_standard_function-naming>disabled</ktlint_standard_function-naming>
                                    <ktlint_standard_no-wildcard-imports>disabled</ktlint_standard_no-wildcard-imports>
                                </editorConfigOverride>
                            </ktlint>
                        </kotlin>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.diffplug.spotless</groupId>
                <artifactId>spotless-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <!-- source JAR -->
                <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>
            <!-- Javadoc JAR -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.11.1</version>
                <configuration>
                    <show>public</show>
                    <charset>UTF-8</charset>
                    <docencoding>UTF-8</docencoding>
                    <links>
                        <link>https://docs.oracle.com/en/java/javase/21/docs/api/</link>
                    </links>
                </configuration>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>aggregate</id>
                        <goals>
                            <goal>aggregate</goal>
                        </goals>
                        <phase>site</phase>
                    </execution>
                </executions>
            </plugin>
            <!-- Central Publishing -->
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <version>0.9.0</version>
                <extensions>true</extensions>
                <configuration>
                    <publishingServerId>central</publishingServerId>
                    <autoPublish>true</autoPublish>
                    <waitUntil>validated</waitUntil>
                    <waitMaxTime>1800</waitMaxTime>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.11.1</version>
                <configuration>
                    <show>public</show>
                    <charset>UTF-8</charset>
                    <docencoding>UTF-8</docencoding>
                    <links>
                        <link>https://docs.oracle.com/en/java/javase/21/docs/api/</link>
                    </links>
                </configuration>
                <reportSets>
                    <reportSet>
                        <id>aggregate</id>
                        <reports>
                            <report>aggregate</report>
                        </reports>
                        <inherited>false</inherited>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

    <profiles>
        <!-- Embabel's published jars are compiled for Java 21, so the adapter only builds on JDK 21+.
             Core and the other adapters keep the Java 17 baseline. -->
        <profile>
            <id>embabel</id>
            <activation>
                <jdk>[21,)</jdk>
            </activation>
            <modules>
                <module>dokimos-embabel</module>
            </modules>
        </profile>
        <profile>
            <id>sign</id>
            <activation>
                <property>
                    <name>sign</name>
                </property>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
