<?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>org.pragmatica-lite</groupId>
    <artifactId>pragmatica</artifactId>
    <version>1.0.0-rc4</version>
    <packaging>pom</packaging>

    <name>Pragmatica</name>
    <description>Pragmatica ecosystem: functional core library, JBCT tooling, and Aether distributed runtime</description>
    <url>https://github.com/pragmaticalabs/pragmatica</url>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
            <comments>Everything except the BSL modules listed in LICENSE</comments>
        </license>
    </licenses>

    <scm>
        <url>https://github.com/pragmaticalabs/pragmatica.git</url>
        <connection>scm:git:ssh://git@github.com/pragmaticalabs/pragmatica.git</connection>
        <developerConnection>scm:git:ssh://git@github.com/pragmaticalabs/pragmatica.git</developerConnection>
        <tag>HEAD</tag>
    </scm>

    <developers>
        <developer>
            <name>Sergiy Yevtushenko</name>
            <email>sergiy.yevtushenko@gmail.com</email>
            <organization>Pragmatica Labs</organization>
            <organizationUrl>https://www.pragmatica-lite.org</organizationUrl>
        </developer>
    </developers>

    <modules>
        <module>core</module>
        <module>integrations</module>
        <module>testing</module>
        <module>test-logging</module>
        <!--
            Leaves a marker in every test fork for as long as its plan runs; the test-plan-gate profile
            below fails a module whose marker outlives the fork (#1344). Depends on nothing here.
        -->
        <module>test-plan-witness</module>
        <module>jbct</module>
        <module>aether</module>
        <module>examples</module>
        <!--
            Runs this repository's operator-facing shell scripts against constructed conditions and
            asserts they cannot report success without having looked (#865, #952). Depends on no
            module, so its position here is free; it sits before cli-docs-gate to keep that module
            last.
        -->
        <module>script-gate</module>
        <!--
            LAST, deliberately. cli-docs-gate reads the live picocli CommandSpec trees of aether/cli
            and jbct/jbct-cli and diffs them against every CLI invocation in this repository's
            Markdown. It test-depends on both CLI modules so no reactor order can run it against a
            CLI that has not been built.
        -->
        <module>cli-docs-gate</module>
        <!--
            Also last: it builds the projects `jbct init` and `jbct add-*` generate, so everything they resolve must be installed
            first, which its test-scoped dependencies guarantee in any build order (#1998).
        -->
        <module>generated-project-gate</module>
    </modules>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <java.release>25</java.release>
        <!-- A module the Central plugin is not bound to (every module that has not opted in) must not run the default deploy
             either (#1988). The Central plugin itself ignores this property: its own skipPublishing decides. -->
        <maven.deploy.skip>true</maven.deploy.skip>
        <!-- The phase the Central plugin's publish goal runs in; `none` outside the release profile (see its <pluginManagement> entry). -->
        <central.publish.phase>none</central.publish.phase>

        <!-- Dependencies -->
        <netty.version>4.2.18.Final</netty.version>
        <slf4j.version>2.0.17</slf4j.version>
        <junit.version>5.13.4</junit.version>
        <junit-platform.version>1.13.4</junit-platform.version>
        <assertj-core.version>3.27.7</assertj-core.version>
        <mockito.version>5.21.0</mockito.version>
        <awaitility.version>4.3.0</awaitility.version>
        <log4j2.version>2.24.3</log4j2.version>
        <picocli.version>4.7.7</picocli.version>
        <asm.version>9.9.1</asm.version>
        <micrometer.version>1.16.1</micrometer.version>
        <onnxruntime.version>1.23.2</onnxruntime.version>

        <!-- Integration Dependencies -->
        <jackson.version>3.1.0</jackson.version>
        <jakarta.persistence.version>3.2.0</jakarta.persistence.version>
        <jooq.version>3.21.1</jooq.version>

        <!-- Maven Plugin versions -->
        <maven-compiler-plugin.version>3.15.0</maven-compiler-plugin.version>
        <maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
        <maven-surefire-plugin.version>3.5.4</maven-surefire-plugin.version>
        <maven-failsafe-plugin.version>3.5.4</maven-failsafe-plugin.version>
        <maven-plugin-api.version>3.9.9</maven-plugin-api.version>
        <maven-plugin-annotations.version>3.15.1</maven-plugin-annotations.version>
        <maven-plugin-plugin.version>4.0.0-beta-2</maven-plugin-plugin.version>
        <jacoco.version>0.8.13</jacoco.version>
        <maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>

        <!-- Default true to avoid reactor cycle; override with -Djbct.skip=false -pl !jbct -->
        <jbct.skip>true</jbct.skip>

        <!-- Virtual thread carrier pool: min 8 to prevent deadlocks on low-vCPU CI runners -->
        <vthread.argLine>-Djdk.virtualThreadScheduler.parallelism=8</vthread.argLine>
    </properties>

    <dependencyManagement>
        <dependencies>
            <!-- Core module -->
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>testing</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>test-logging</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Integration Modules -->
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>jackson</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>micrometer</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>jpa</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>jooq</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>http-routing</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>toml</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>config-service</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>http-client</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>http-server</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>messaging</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>utility</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>dht</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>consensus</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>tcp</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>dns</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>serialization-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>serialization-codec-processor</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>net-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>cluster</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>hetzner</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>azure</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>gcp</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>aws</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>swim</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>storage</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>smtp</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>email-http</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>jackson-xml</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- JBCT modules -->
            <dependency>
                <groupId>org.pragmatica-lite</groupId>
                <artifactId>jbct-core</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Aether modules -->
            <dependency>
                <groupId>org.pragmatica-lite.aether</groupId>
                <artifactId>slice-annotations</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite.aether</groupId>
                <artifactId>slice-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite.aether</groupId>
                <artifactId>resource-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite.aether</groupId>
                <artifactId>slice</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite.aether</groupId>
                <artifactId>node</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite.aether</groupId>
                <artifactId>aether-ttm</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite.aether</groupId>
                <artifactId>forge-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite.aether</groupId>
                <artifactId>http-routing-adapter</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite.aether</groupId>
                <artifactId>environment-integration</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite.aether</groupId>
                <artifactId>environment-gcp</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite.aether</groupId>
                <artifactId>environment-hetzner</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite.aether</groupId>
                <artifactId>environment-azure</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite.aether</groupId>
                <artifactId>environment-aws</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite.aether</groupId>
                <artifactId>resource-interceptors</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>org.pragmatica-lite.aether</groupId>
                <artifactId>resource-notification</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- Logging -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${slf4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-core</artifactId>
                <version>${log4j2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-slf4j2-impl</artifactId>
                <version>${log4j2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-jpl</artifactId>
                <version>${log4j2.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.logging.log4j</groupId>
                <artifactId>log4j-layout-template-json</artifactId>
                <version>${log4j2.version}</version>
            </dependency>

            <!-- Testing -->
            <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>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-engine</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.junit.jupiter</groupId>
                <artifactId>junit-jupiter-params</artifactId>
                <version>${junit.version}</version>
                <scope>test</scope>
            </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>${assertj-core.version}</version>
                <scope>test</scope>
            </dependency>
            <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>
            <dependency>
                <groupId>org.awaitility</groupId>
                <artifactId>awaitility</artifactId>
                <version>${awaitility.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- Netty -->
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-all</artifactId>
                <version>${netty.version}</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-codec-http3</artifactId>
                <version>${netty.version}</version>
            </dependency>

            <!-- CLI -->
            <dependency>
                <groupId>info.picocli</groupId>
                <artifactId>picocli</artifactId>
                <version>${picocli.version}</version>
            </dependency>

            <!-- Maven Plugin API -->
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-plugin-api</artifactId>
                <version>${maven-plugin-api.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.plugin-tools</groupId>
                <artifactId>maven-plugin-annotations</artifactId>
                <version>${maven-plugin-annotations.version}</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.maven</groupId>
                <artifactId>maven-core</artifactId>
                <version>${maven-plugin-api.version}</version>
                <scope>provided</scope>
            </dependency>

            <!-- Integration External Dependencies -->
            <dependency>
                <groupId>tools.jackson.core</groupId>
                <artifactId>jackson-databind</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>tools.jackson.dataformat</groupId>
                <artifactId>jackson-dataformat-xml</artifactId>
                <version>${jackson.version}</version>
            </dependency>
            <dependency>
                <groupId>com.fasterxml.jackson.core</groupId>
                <artifactId>jackson-annotations</artifactId>
                <version>2.21</version>
            </dependency>
            <dependency>
                <groupId>io.micrometer</groupId>
                <artifactId>micrometer-core</artifactId>
                <version>${micrometer.version}</version>
            </dependency>
            <dependency>
                <groupId>io.micrometer</groupId>
                <artifactId>micrometer-registry-prometheus</artifactId>
                <version>${micrometer.version}</version>
            </dependency>
            <dependency>
                <groupId>jakarta.persistence</groupId>
                <artifactId>jakarta.persistence-api</artifactId>
                <version>${jakarta.persistence.version}</version>
            </dependency>
            <dependency>
                <groupId>org.jooq</groupId>
                <artifactId>jooq</artifactId>
                <version>${jooq.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <!-- Version pinned here because slice-processor-tests binds a clean execution (#736);
                     an unversioned declaration floats with the Maven distribution and Maven warns
                     that it "threatens the stability of your build". -->
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>${maven-clean-plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${maven-compiler-plugin.version}</version>
                    <configuration>
                        <showDeprecation>true</showDeprecation>
                        <showWarnings>true</showWarnings>
                        <source>${java.release}</source>
                        <target>${java.release}</target>
                        <compilerArgs>
                            <arg>-proc:full</arg>
                        </compilerArgs>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>${maven-surefire-plugin.version}</version>
                    <configuration>
                        <argLine>${vthread.argLine}</argLine>
                        <excludes>
                            <exclude>**/*IT.java</exclude>
                        </excludes>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-failsafe-plugin</artifactId>
                    <version>${maven-failsafe-plugin.version}</version>
                    <configuration>
                        <argLine>${vthread.argLine}</argLine>
                        <includes>
                            <include>**/*IT.java</include>
                        </includes>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>integration-test</goal>
                                <goal>verify</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>versions-maven-plugin</artifactId>
                    <version>2.21.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>3.4.0</version>
                    <executions>
                        <execution>
                            <id>attach-sources</id>
                            <phase>package</phase>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>3.12.0</version>
                    <executions>
                        <execution>
                            <id>attach-javadocs</id>
                            <goals>
                                <goal>jar</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <doclint>none</doclint>
                        <failOnError>false</failOnError>
                        <quiet>true</quiet>
                        <additionalOptions>
                            <additionalOption>--no-fonts</additionalOption>
                        </additionalOptions>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-gpg-plugin</artifactId>
                    <version>3.2.8</version>
                    <executions>
                        <execution>
                            <id>sign-artifacts</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>sign</goal>
                            </goals>
                        </execution>
                    </executions>
                </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>
                        <!--
                            Publishing is OPT-IN (#1988, #1989). A module the plugin is bound to takes this default; a module publishes only
                            when its own pom declares this plugin in <build><plugins> with <skipPublishing>false</skipPublishing>. Only the
                            Central plugin's `skipPublishing` excludes a module: `maven.deploy.skip` is ignored by it. A parent pom that
                            publishes while its children do not declares the entry with <inherited>false</inherited>.
                            docs/release/maven-central-publish-set.md decides every module; tools/check-publish-closure.py gates it.
                        -->
                        <skipPublishing>true</skipPublishing>
                    </configuration>
                    <executions>
                        <!--
                            The Central plugin's `publish` goal is injected into the deploy phase of every module that declares the plugin.
                            It acts ONLY in a release build: without -DperformRelease=true the phase is `none`, so a plain `mvn deploy`
                            uploads nothing to Central, unsigned or otherwise (v-1997: it used to send an unsigned bundle, and with
                            autoPublish that is an irreversible publish from a casual command).
                        -->
                        <execution>
                            <id>injected-central-publishing</id>
                            <phase>${central.publish.phase}</phase>
                            <goals>
                                <goal>publish</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-plugin-plugin</artifactId>
                    <version>${maven-plugin-plugin.version}</version>
                    <dependencies>
                        <dependency>
                            <groupId>org.ow2.asm</groupId>
                            <artifactId>asm</artifactId>
                            <version>${asm.version}</version>
                        </dependency>
                    </dependencies>
                </plugin>
                <plugin>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.6.1</version>
                    <configuration>
                        <createDependencyReducedPom>false</createDependencyReducedPom>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco.version}</version>
                    <executions>
                        <execution>
                            <id>prepare-agent</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>prepare-agent-integration</id>
                            <goals>
                                <goal>prepare-agent-integration</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>report</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.pragmatica-lite</groupId>
                    <artifactId>jbct-maven-plugin</artifactId>
                    <version>${project.version}</version>
                    <configuration>
                        <skip>${jbct.skip}</skip>
                    </configuration>
                    <executions>
                        <execution>
                            <goals>
                                <goal>process</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.sonatype.central</groupId>
                <artifactId>central-publishing-maven-plugin</artifactId>
                <inherited>false</inherited>
                <configuration>
                    <skipPublishing>false</skipPublishing>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>versions-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>release</id>
            <activation>
                <property>
                    <name>performRelease</name>
                    <value>true</value>
                </property>
            </activation>
            <properties>
                <central.publish.phase>deploy</central.publish.phase>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                    </plugin>
                    <!--
                        The Central plugin is not listed here: it is bound by each published module's own pom (opt-in, see its
                        <pluginManagement> entry), so a module that says nothing is never uploaded (#1988). The closure gate
                        runs first, so a release whose published set is not closed under its dependencies stops before the upload.
                    -->
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>3.1.0</version>
                        <inherited>false</inherited>
                        <executions>
                            <execution>
                                <id>published-set-closure</id>
                                <phase>validate</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <!-- The gate's lines are INFO output, which `mvn -q` (scripts/release.sh) hides; the failure message is
                                         an ERROR and is not hidden, so it carries them. -->
                                    <target>
                                        <exec executable="python3" dir="${project.basedir}" resultproperty="closure.gate.rc"
                                              outputproperty="closure.gate.out" errorproperty="closure.gate.err" failifexecutionfails="true">
                                            <arg value="tools/check-publish-closure.py"/>
                                        </exec>
                                        <fail message="The published set is not closed (tools/check-publish-closure.py exited ${closure.gate.rc}):${line.separator}${closure.gate.err}${line.separator}${closure.gate.out}">
                                            <condition>
                                                <not>
                                                    <equals arg1="${closure.gate.rc}" arg2="0"/>
                                                </not>
                                            </condition>
                                        </fail>
                                        <!-- A PASSING gate still states what it examined: a green with no count is not a result. -->
                                        <echo message="${closure.gate.out}"/>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>coverage</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <!--
            A crashed fork must fail the build (#1344). Surefire fails a fork that dies without saying
            goodbye, but a fork whose test plan ends early and then says goodbye exits 0 and reads as
            BUILD SUCCESS with every later class unrun (observed 2026-09-19: a StackOverflowError inside
            java.lang.StringBuffer's static initialiser poisoned the class, the failure report then threw
            NoClassDefFoundError out of the launcher, and ForkedBooter said goodbye from its finally).
            Two witnesses are read after each test phase, and either surviving fails the module:
              - `target/test-plan-witness/*.plan-incomplete`: written by test-plan-witness when the
                JUnit plan starts, removed only when the plan finishes. Fail-closed: whatever ends the
                plan early leaves it. One directory for both plugins, because the fork cannot tell
                which one launched it.
              - `<reports>/*-jvmRun*.dump`: surefire's own fork-side error dump (the provider threw, a shutdown
                command, a ping timeout, the 30 s exit deadline). Historical dumps in this workspace all
                belong to killed runs.
            Both directories are swept of stale witnesses right before the plugin that fills them, so the
            verdict is about THIS run and a Ctrl-C last week cannot fail today's green build. Skipped
            with -DskipTests, like the tests themselves.
        -->
        <profile>
            <id>test-plan-gate</id>
            <activation>
                <file>
                    <exists>src/test</exists>
                </file>
            </activation>
            <dependencies>
                <dependency>
                    <groupId>org.pragmatica-lite</groupId>
                    <artifactId>test-plan-witness</artifactId>
                    <version>${project.version}</version>
                    <scope>test</scope>
                </dependency>
            </dependencies>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>${maven-antrun-plugin.version}</version>
                        <configuration>
                            <skip>${skipTests}</skip>
                        </configuration>
                        <executions>
                            <execution>
                                <id>sweep-unit-test-witnesses</id>
                                <phase>process-test-classes</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <!-- The directory itself goes: the listener recreates it, and its absence
                                             after a run that wrote XML is how the gate tells a plan that finished
                                             from a witness that never ran. -->
                                        <delete dir="${project.build.directory}/test-plan-witness" quiet="true"/>
                                        <delete quiet="true">
                                            <fileset dir="${project.build.directory}/surefire-reports" erroronmissingdir="false">
                                                <include name="*-jvmRun*.dump"/>
                                            </fileset>
                                        </delete>
                                        <!-- Reports are never swept, so the silent-witness check below only counts
                                             XML written after this moment. -->
                                        <touch file="${project.build.directory}/test-plan-witness-unit.stamp" mkdirs="true"/>
                                    </target>
                                </configuration>
                            </execution>
                            <execution>
                                <id>unit-test-plan-completed</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <pathconvert property="witness.markers" pathsep="${line.separator}">
                                            <fileset dir="${project.build.directory}/test-plan-witness" erroronmissingdir="false">
                                                <include name="*.plan-incomplete"/>
                                            </fileset>
                                        </pathconvert>
                                        <pathconvert property="witness.dumps" pathsep="${line.separator}">
                                            <fileset dir="${project.build.directory}/surefire-reports" erroronmissingdir="false">
                                                <include name="*-jvmRun*.dump"/>
                                            </fileset>
                                        </pathconvert>
                                        <condition property="witness.markers.text" value="${witness.markers}" else="(none)">
                                            <not>
                                                <equals arg1="${witness.markers}" arg2=""/>
                                            </not>
                                        </condition>
                                        <condition property="witness.dumps.text" value="${witness.dumps}" else="(none)">
                                            <not>
                                                <equals arg1="${witness.dumps}" arg2=""/>
                                            </not>
                                        </condition>
                                        <fail message="A test fork left evidence that surefire's exit status cannot see (#1344).${line.separator}plan incomplete (the fork ended before running everything it planned; the file lists the plan): ${witness.markers.text}${line.separator}surefire fork dump present (the fork reported a problem; with nothing listed above the plan finished and it happened after the tests, e.g. the fork could not exit within 30 s; read the dump): ${witness.dumps.text}">
                                            <condition>
                                                <or>
                                                    <not>
                                                        <equals arg1="${witness.markers}" arg2=""/>
                                                    </not>
                                                    <not>
                                                        <equals arg1="${witness.dumps}" arg2=""/>
                                                    </not>
                                                </or>
                                            </condition>
                                        </fail>
                                        <!-- A witness that never ran looks exactly like a plan that finished. The
                                             listener creates this directory at every plan start, so XML from THIS run
                                             (newer than the sweep's stamp; reports are never swept) without it means
                                             the marker half is off (a deactivated listener, a dropped dependency) and
                                             the unit run was dump-gated only. -->
                                        <condition property="witness.silent">
                                            <and>
                                                <resourcecount when="greater" count="0">
                                                    <fileset dir="${project.build.directory}/surefire-reports" erroronmissingdir="false">
                                                        <include name="TEST-*.xml"/>
                                                        <depend targetdir="${project.build.directory}">
                                                            <mapper type="merge" to="test-plan-witness-unit.stamp"/>
                                                        </depend>
                                                    </fileset>
                                                </resourcecount>
                                                <not>
                                                    <available file="${project.build.directory}/test-plan-witness" type="dir"/>
                                                </not>
                                            </and>
                                        </condition>
                                        <fail if="witness.silent" message="surefire wrote test reports but no test plan was witnessed (#1344): ${project.build.directory}/test-plan-witness does not exist, so the test-plan-witness listener did not run in this module's forks (deactivated in junit-platform.properties, or the test-plan-gate dependency is missing). The crash gate was dump-only for this run."/>
                                    </target>
                                </configuration>
                            </execution>
                            <execution>
                                <id>sweep-integration-test-witnesses</id>
                                <phase>pre-integration-test</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <!-- The directory itself goes: the listener recreates it, and its absence
                                             after a run that wrote XML is how the gate tells a plan that finished
                                             from a witness that never ran. -->
                                        <delete dir="${project.build.directory}/test-plan-witness" quiet="true"/>
                                        <delete quiet="true">
                                            <fileset dir="${project.build.directory}/failsafe-reports" erroronmissingdir="false">
                                                <include name="*-jvmRun*.dump"/>
                                            </fileset>
                                        </delete>
                                        <!-- Reports are never swept, so the silent-witness check below only counts
                                             XML written after this moment. -->
                                        <touch file="${project.build.directory}/test-plan-witness-integration-test.stamp" mkdirs="true"/>
                                    </target>
                                </configuration>
                            </execution>
                            <execution>
                                <id>integration-test-plan-completed</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <configuration>
                                    <target>
                                        <pathconvert property="witness.markers" pathsep="${line.separator}">
                                            <fileset dir="${project.build.directory}/test-plan-witness" erroronmissingdir="false">
                                                <include name="*.plan-incomplete"/>
                                            </fileset>
                                        </pathconvert>
                                        <pathconvert property="witness.dumps" pathsep="${line.separator}">
                                            <fileset dir="${project.build.directory}/failsafe-reports" erroronmissingdir="false">
                                                <include name="*-jvmRun*.dump"/>
                                            </fileset>
                                        </pathconvert>
                                        <condition property="witness.markers.text" value="${witness.markers}" else="(none)">
                                            <not>
                                                <equals arg1="${witness.markers}" arg2=""/>
                                            </not>
                                        </condition>
                                        <condition property="witness.dumps.text" value="${witness.dumps}" else="(none)">
                                            <not>
                                                <equals arg1="${witness.dumps}" arg2=""/>
                                            </not>
                                        </condition>
                                        <fail message="An integration-test fork left evidence that failsafe's exit status cannot see (#1344).${line.separator}plan incomplete (the fork ended before running everything it planned; the file lists the plan): ${witness.markers.text}${line.separator}surefire fork dump present (the fork reported a problem; with nothing listed above the plan finished and it happened after the tests, e.g. the fork could not exit within 30 s; read the dump): ${witness.dumps.text}">
                                            <condition>
                                                <or>
                                                    <not>
                                                        <equals arg1="${witness.markers}" arg2=""/>
                                                    </not>
                                                    <not>
                                                        <equals arg1="${witness.dumps}" arg2=""/>
                                                    </not>
                                                </or>
                                            </condition>
                                        </fail>
                                        <!-- A witness that never ran looks exactly like a plan that finished. The
                                             listener creates this directory at every plan start, so XML from THIS run
                                             (newer than the sweep's stamp; reports are never swept) without it means
                                             the marker half is off (a deactivated listener, a dropped dependency) and
                                             the integration-test run was dump-gated only. -->
                                        <condition property="witness.silent">
                                            <and>
                                                <resourcecount when="greater" count="0">
                                                    <fileset dir="${project.build.directory}/failsafe-reports" erroronmissingdir="false">
                                                        <include name="TEST-*.xml"/>
                                                        <depend targetdir="${project.build.directory}">
                                                            <mapper type="merge" to="test-plan-witness-integration-test.stamp"/>
                                                        </depend>
                                                    </fileset>
                                                </resourcecount>
                                                <not>
                                                    <available file="${project.build.directory}/test-plan-witness" type="dir"/>
                                                </not>
                                            </and>
                                        </condition>
                                        <fail if="witness.silent" message="failsafe wrote test reports but no test plan was witnessed (#1344): ${project.build.directory}/test-plan-witness does not exist, so the test-plan-witness listener did not run in this module's forks (deactivated in junit-platform.properties, or the test-plan-gate dependency is missing). The crash gate was dump-only for this run."/>
                                    </target>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>exclude-tagged-tests</id>
            <activation>
                <file>
                    <exists>src/test</exists>
                </file>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <configuration>
                            <excludedGroups>Infinite, Slow, Benchmark, S3</excludedGroups>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
