<?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>

    <groupId>dev.relism</groupId>
    <artifactId>flash-parent</artifactId>
    <version>2.1.0-dd0455c</version>
    <packaging>pom</packaging>

    <modules>
        <module>flash</module>
        <module>flash-testing</module>
        <module>flash-extensions</module>
    </modules>

    <distributionManagement>
        <repository>
            <id>Personal</id>
            <url>https://maven.relism.dev/releases</url>
        </repository>
        <snapshotRepository>
            <id>Personal-snapshots</id>
            <url>https://maven.relism.dev/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <maven.compiler.source>21</maven.compiler.source>
        <maven.compiler.target>21</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <lombok.version>1.18.44</lombok.version>
        <slf4j.version>2.0.16</slf4j.version>
        <maven.javadoc.plugin.version>3.11.2</maven.javadoc.plugin.version>
        <maven.source.plugin.version>3.3.1</maven.source.plugin.version>
        <maven.gpg.plugin.version>3.2.8</maven.gpg.plugin.version>
        <maven.versions.plugin.version>2.18.0</maven.versions.plugin.version>
        <jmh.version>1.37</jmh.version>
        <junit.version>5.11.0</junit.version>
        <caffeine.version>3.1.8</caffeine.version>
        <jakarta.validation.version>3.1.1</jakarta.validation.version>
        <build.helper.plugin.version>3.6.0</build.helper.plugin.version>
    </properties>

    <repositories>
        <!--
          maven.relism.dev went down; fpr-core's source (dev.relism/FastPathRouter) now
          publishes to Gitea's own Maven registry instead, via that repo's
          .gitea/workflows/publish-maven.yml (same pattern as this project's own). Public repo
          owned by a public Gitea user, so this resolves anonymously — no credentials needed.
        -->
        <repository>
            <id>gitea-fastpathrouter</id>
            <name>Gitea Maven Registry (Relism/FastPathRouter)</name>
            <url>https://git.pixel-services.com/api/packages/Relism/maven</url>
        </repository>
    </repositories>

    <dependencyManagement>
        <dependencies>
            <!--
              Every module of this build, so anything composing Flash imports this POM once and
              never names a version again. An extension left out here is one a consumer has to
              pin by hand, which is how two versions of Flash end up on one classpath.
            -->
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-security-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-security-apikey</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-security-form</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-security-oauth-server</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-security-test</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-data-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-data-jdbc</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-data-hibernate</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-testing</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.validation</groupId>
                <artifactId>jakarta.validation-api</artifactId>
                <version>${jakarta.validation.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-scheduler</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-cache-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-cache-caffeine</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-jackson-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-jackson-json</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-jackson-xml</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-openapi</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-security-oidc</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-routeviewer</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-view-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-view-jte</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-view-thymeleaf</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-limiter</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-vite</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>flash-ext-mcp</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>dev.relism</groupId>
                <artifactId>fpr-core</artifactId>
                <!-- Gitea can't republish an existing name+version, so FastPathRouter's CI
                     stamps a commit-scoped version on every push — see its own
                     .gitea/workflows/publish-maven.yml. Bump by hand to pick up newer
                     FastPathRouter changes, same precedent as Pathway's flash.version. -->
                <version>1.1.0-36216cd</version>
            </dependency>
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${slf4j.version}</version>
                <scope>runtime</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>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>3.2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.projectlombok</groupId>
                                <artifactId>lombok</artifactId>
                                <version>${lombok.version}</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>${maven.source.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>${maven.javadoc.plugin.version}</version>
                    <configuration>
                        <source>${maven.compiler.source}</source>
                        <encoding>${project.build.sourceEncoding}</encoding>
                        <doclint>none</doclint>
                        <failOnError>true</failOnError>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>${maven.gpg.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>${maven.versions.plugin.version}</version>
                    <configuration>
                        <generateBackupPoms>false</generateBackupPoms>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-deploy-plugin</artifactId>
                    <version>3.1.2</version>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <profiles>
        <profile>
            <id>attach-artifacts</id>
            <activation>
                <file>
                    <exists>src/main/java</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>sign-artifacts</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </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>
