<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ PrOOPt — Object-Oriented Prompt Engineering for Java.
  ~
  ~ Copyright (c) 2026 Akshay Rawal
  ~ SPDX-License-Identifier: MIT
  -->
<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>

    <groupId>io.github.argonizer</groupId>
    <artifactId>prooopt-parent</artifactId>
    <version>0.1.1</version>
    <packaging>pom</packaging>

    <name>PrOOPt Parent</name>
    <description>
        PrOOPt — Object-Oriented Prompt Engineering for the JVM. Scoped, auditable LLM usage declared
        at the function level: deterministic code, bounded on-device AI, or explicitly elevated cloud AI.
    </description>
    <url>https://github.com/argonizer/PrOOPt</url>
    <inceptionYear>2026</inceptionYear>

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

    <developers>
        <developer>
            <id>argonizer</id>
            <name>Akshay Rawal</name>
            <url>https://github.com/argonizer</url>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:https://github.com/argonizer/PrOOPt.git</connection>
        <developerConnection>scm:git:git@github.com:argonizer/PrOOPt.git</developerConnection>
        <url>https://github.com/argonizer/PrOOPt</url>
        <tag>HEAD</tag>
    </scm>

    <modules>
        <module>prooopt-core</module>
        <module>prooopt-apt</module>
        <module>prooopt-maven-plugin</module>
        <module>prooopt-runtime-local</module>
        <module>prooopt-runtime-cloud</module>
        <module>prooopt-states</module>
        <module>prooopt-states-spring-boot-starter</module>
        <module>prooopt-examples</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <!--
          PrOOPt targets Java 17 (LTS) across every module. All concurrency uses platform
          threads (cloud I/O on an elastic daemon pool, LOCAL inference on a bounded pool) — no
          virtual threads, so nothing requires Java 21. Every language feature PrOOPt uses —
          records, sealed types, pattern matching, switch expressions — is available on Java 17.
          No preview or incubator (Vector API) modules are required.
        -->
        <java.release>17</java.release>
        <maven.compiler.release>${java.release}</maven.compiler.release>

        <!-- Dependency versions (managed centrally for all modules). -->
        <guava.version>33.4.8-jre</guava.version>
        <auto-service.version>1.1.1</auto-service.version>
        <spring.version>6.2.18</spring.version>
        <spring-boot.version>3.5.14</spring-boot.version>
        <aspectjweaver.version>1.9.24</aspectjweaver.version>
        <jackson.version>2.21.4</jackson.version>
        <log4j2.version>2.26.0</log4j2.version>
        <snakeyaml.version>2.4</snakeyaml.version>
        <junit.version>5.14.4</junit.version>
        <mockito.version>5.20.0</mockito.version>

        <!-- Runtime engines. -->
        <anthropic.version>2.35.0</anthropic.version>

        <!-- Plugin versions. -->
        <maven-compiler-plugin.version>3.14.1</maven-compiler-plugin.version>
        <maven-surefire-plugin.version>3.5.4</maven-surefire-plugin.version>
        <maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>

        <!-- Release-profile plugin versions. -->
        <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
        <maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
        <maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
        <central-publishing-plugin.version>0.7.0</central-publishing-plugin.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- BOM imports keep multi-artifact families version-aligned. -->
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-framework-bom</artifactId>
                <version>${spring.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson</groupId>
                <artifactId>jackson-bom</artifactId>
                <version>${jackson.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-bom</artifactId>
                <version>${log4j2.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.junit</groupId>
                <artifactId>junit-bom</artifactId>
                <version>${junit.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

            <!-- AspectJ weaver for @Aspect support under Spring AOP. -->
            <dependency>
                <groupId>org.aspectj</groupId>
                <artifactId>aspectjweaver</artifactId>
                <version>${aspectjweaver.version}</version>
            </dependency>

            <!-- YAML config loading for the plain-Java (non-Spring) path. -->
            <dependency>
                <groupId>org.yaml</groupId>
                <artifactId>snakeyaml</artifactId>
                <version>${snakeyaml.version}</version>
            </dependency>

            <!-- Optional Spring Boot auto-configuration. -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-autoconfigure</artifactId>
                <version>${spring-boot.version}</version>
            </dependency>

            <!-- Anthropic cloud SDK. -->
            <dependency>
                <groupId>com.anthropic</groupId>
                <artifactId>anthropic-java</artifactId>
                <version>${anthropic.version}</version>
            </dependency>

            <!-- Reactor modules of this build. -->
            <dependency>
                <groupId>io.github.argonizer</groupId>
                <artifactId>prooopt-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.argonizer</groupId>
                <artifactId>prooopt-runtime-local</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.github.argonizer</groupId>
                <artifactId>prooopt-runtime-cloud</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Guava: rate limiting and utilities used by prooopt-states. -->
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>

            <!-- Google Auto-Service: generates META-INF/services entries. -->
            <dependency>
                <groupId>com.google.auto.service</groupId>
                <artifactId>auto-service</artifactId>
                <version>${auto-service.version}</version>
                <optional>true</optional>
            </dependency>

            <!-- JPA annotations (provided/optional — no runtime dep in core). -->
            <dependency>
                <groupId>jakarta.persistence</groupId>
                <artifactId>jakarta.persistence-api</artifactId>
                <version>3.2.0</version>
                <optional>true</optional>
            </dependency>

            <!-- Spring Boot starters managed centrally. -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-jpa</artifactId>
                <version>${spring-boot.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-batch</artifactId>
                <version>${spring-boot.version}</version>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-configuration-processor</artifactId>
                <version>${spring-boot.version}</version>
                <optional>true</optional>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <version>${spring-boot.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.batch</groupId>
                <artifactId>spring-batch-test</artifactId>
                <version>5.2.4</version>
                <scope>test</scope>
            </dependency>

            <!-- H2 in-memory database for persistence tests. -->
            <dependency>
                <groupId>com.h2database</groupId>
                <artifactId>h2</artifactId>
                <version>2.3.232</version>
                <scope>test</scope>
            </dependency>

            <!-- Flyway schema management used in the starter. -->
            <dependency>
                <groupId>org.flywaydb</groupId>
                <artifactId>flyway-core</artifactId>
                <version>11.9.1</version>
            </dependency>

            <!-- prooopt-states core — managed so the starter can import it. -->
            <dependency>
                <groupId>io.github.argonizer</groupId>
                <artifactId>prooopt-states</artifactId>
                <version>${project.version}</version>
            </dependency>

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

    <dependencies>
        <!-- Every module gets the JUnit 5 engine for tests. -->
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <release>${maven.compiler.release}</release>
                        <!-- Required: PrOOPt resolves {paramName} placeholders from method
                             parameter names via reflection, which needs -parameters. -->
                        <parameters>true</parameters>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>${maven-jar-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.sonatype.central</groupId>
                    <artifactId>central-publishing-maven-plugin</artifactId>
                    <version>0.10.0</version>
                    <extensions>true</extensions>
                    <configuration>
                        <publishingServerId>central</publishingServerId>
                        <autoPublish>true</autoPublish>
                        <waitUntil>published</waitUntil>
                    </configuration>
                </plugin>
            </plugins>
            <!-- Central Portal publisher — replaces old nexus-staging-maven-plugin -->
        </pluginManagement>

        <plugins>
            <!--
              central-publishing-maven-plugin MUST be in the main build (not a profile) so it
              registers as a lifecycle extension and replaces maven-deploy-plugin before Maven
              evaluates profiles. When declared only inside a profile the extension is loaded too
              late and maven-deploy-plugin fires first (failing because distributionManagement is
              absent). Skip is true by default; the "release" profile overrides it to false.
            -->
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <!-- Sources JAR — required by Central -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.4.0</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals><goal>jar-no-fork</goal></goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Javadoc JAR — required by Central -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.12.0</version>
                        <configuration>
                            <!-- Disable all doclint checks so missing @param/@return tags
                                 in internal classes don't fail the release build. -->
                            <doclint>none</doclint>
                            <failOnError>false</failOnError>
                            <quiet>true</quiet>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals><goal>jar</goal></goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- GPG signing — required by Central -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.2.7</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals><goal>sign</goal></goals>
                            </execution>
                        </executions>
                    </plugin>

                    <!-- Activate the publisher declared in the main build. -->
                    <plugin>
                        <groupId>org.sonatype.central</groupId>
                        <artifactId>central-publishing-maven-plugin</artifactId>
                        <configuration>
                            <skip>false</skip>
                        </configuration>
                    </plugin>

                </plugins>
            </build>
        </profile>
    </profiles>
</project>

