Maven reference

StoatFlow's Maven support — the stoatflow-bom, the stoatflow-parent convention POM, and the stoatflow-maven-plugin. The three artifacts, every <properties> key, the four goals, and the pinned plugin versions.

StoatFlow gives Maven projects the same build conventions as the Gradle plugin, through three published artifacts under io.stoatflow. This page enumerates them; for the setup walkthrough see Project setup.

The three artifacts

ArtifactWhat it is
io.stoatflow:stoatflow-bomA Maven BOM (<dependencyManagement> import) that aligns the StoatFlow modules — stoatflow-core, stoatflow-runtime, stoatflow-config (the configuration layer stoatflow-runtime brings in), stoatflow-test-utils, stoatflow-test-runtime — with their tested kafka-clients / rocksdbjni / micrometer versions and imports the JUnit BOM.
io.stoatflow:stoatflow-parentThe convention parent POM — Java release 25, kotlin-maven jvmTarget 25, the shade fat JAR, the surefire/failsafe IntegrationTest tag-split, exec:exec run, and the stoatflow-docker / stoatflow-native profiles. Imports the BOM for you.
io.stoatflow:stoatflow-maven-pluginFour goals (prefix stoatflow) for the things XML can't express: RocksDB auto-detection, the staged native docker build, and the forked run with the JVM args.

Set up

Inherit from the parent and declare your dependency (its version comes from the BOM the parent imports — so you omit it):

<!-- pom.xml -->
<parent>
  <groupId>io.stoatflow</groupId>
  <artifactId>stoatflow-parent</artifactId>
  <version>REPLACE-WITH-CURRENT-RELEASE</version>   <!-- literal — Maven can't resolve a property in <parent> -->
  <relativePath/>
</parent>

<properties>
  <stoatflow.mainClass>com.example.Main</stoatflow.mainClass>
</properties>

<dependencies>
  <dependency>
    <groupId>io.stoatflow</groupId>
    <artifactId>stoatflow-runtime</artifactId>
    <!-- version managed by the imported stoatflow-bom -->
  </dependency>
  <dependency>
    <groupId>io.stoatflow</groupId>
    <artifactId>stoatflow-test-utils</artifactId>
    <scope>test</scope>
  </dependency>
</dependencies>

The current release is 1.0.0-rc.6 — substitute it for the REPLACE-WITH-CURRENT-RELEASE placeholder (the <parent> version must be a literal; Maven does not interpolate properties in parent coordinates). For a Kotlin project, point Maven at src/main/kotlin, add the kotlin-stdlib (version ${kotlin.version}, from the parent), and use the …Kt main class — the parent already configures kotlin-maven-plugin (jvmTarget 25) and binds its compile/test-compile phases.

Short goal prefix (mvn stoatflow:…). To call the plugin's standalone goals by their short prefix, add io.stoatflow to <pluginGroups> in your ~/.m2/settings.xml:
<pluginGroups>
  <pluginGroup>io.stoatflow</pluginGroup>
</pluginGroups>
Without it, use full coordinates — e.g. mvn io.stoatflow:stoatflow-maven-plugin:run.

What the parent configures

ConventionDetail
Compiler--release 25 (javac).
Kotlinkotlin-maven-plugin jvmTarget 25.
Fat JARmaven-shade-plugin produces a <finalName>-all.jar with the Main-Class manifest + merged service files.
Unit testsmaven-surefire-plugin on JUnit Platform with the native-access JVM arg; excludes @Tag("IntegrationTest").
Integration testsmaven-failsafe-plugin runs only @Tag("IntegrationTest"), bound to integration-test / verify.
Runexec-maven-plugin configured for exec:exec — a forked JVM so the JVM args (--enable-native-access=ALL-UNNAMED, -XX:+UseG1GC) apply (exec:java runs in Maven's own JVM and can't).
Profilesstoatflow-docker (Jib image at package), stoatflow-native (native compile at package), and host-arch selection.

The parent targets release 25, and a build with Maven running on JDK 26 or later works — Java and Kotlin sources, and the stoatflow-docker image profile.

StoatFlow uses no JDK preview features, so the parent adds no --enable-preview. If your own code uses preview features, add the flag yourself: to stoatflow.jvmArgs (the run) and stoatflow.testJvmArgs (surefire and failsafe) — they replace the defaults, so keep those, e.g. <stoatflow.jvmArgs>${stoatflow.mandatoryJvmArgs} -XX:+UseG1GC --enable-preview</stoatflow.jvmArgs> — to stoatflow.docker.jvmFlags for the image (-XX:+UseG1GC --enable-preview), and to the maven-compiler-plugin's <compilerArgs><arg>--enable-preview</arg></compilerArgs>.

Properties reference

Set these in your <properties>. Defaults come from the parent.

PropertyDefaultDescription
stoatflow.mainClass(required)Application entry point. stoatflow:configure fails the build if unset.
stoatflow.docker.imageName${project.artifactId}Image name. Tagged latest + <version>.
stoatflow.docker.port8080Exposed container port.
stoatflow.docker.user1000:1000Non-root run-as user.
stoatflow.docker.baseImageeclipse-temurin:25-jre-nobleJVM base image.
stoatflow.docker.stateDir/data/stateRocksDB state dir → STOATFLOW_STATE_DIR — the environment variable of stoatflow.state.dir, so it wins over the YAML; a STOATFLOW_STATE_DIR set at run time replaces it. The image contains it, writable by its user (an absolute path). Mount a volume here.
stoatflow.docker.memoryProfilebalancedThe memory profile the entrypoint sizes the heap with → STOATFLOW_MEMORY_PROFILE: balanced, state-heavy, heap-heavy or lean (small, low-throughput apps: 256 MiB pods stateless, 512 MiB stateful, half that in a native image). The engine sizes RocksDB from what the heap leaves. Baked into the JVM image and, as a build arg, the native one; the variable overrides it at deploy time. Any other value fails the build. See The memory plan.
stoatflow.docker.heapMbemptyA fixed heap in MiB → STOATFLOW_HEAP_MB, instead of the profile's brackets. Empty = the variable is omitted. Must be a positive integer without leading zeros, or the build fails.
stoatflow.docker.reproducibleBuildtruePin creationTime to the HEAD commit.
stoatflow.docker.jvmFlags-XX:+UseG1GCContainer JVM flags, part of the image's entrypoint (native-access always added).
stoatflow.nativeImage.gcempty--gc value for the native docker build (e.g. G1; needs Oracle GraalVM).
stoatflow.nativeImage.runtimeTargetruntimeDocker target stage for native-docker-build (runtime or runtime-lean).
stoatflow.nativeImage.removeInitializeAtRunTimeemptyComma-separated --initialize-at-run-time entries to drop from the curated base.
creationTime and the docker executable carry no <properties> default. Maven's model interpolator bakes <properties> into the plugin <configuration>before any Mojo runs, which would override what stoatflow:configure computes — so these stay undefined and resolve live from it. To add native flags (the counterpart of Gradle's additionalInitializeAtRunTime), extend the native-maven-plugin<buildArgs> in your POM, or ship reachability metadata with your value classes (see Native image → Custom serde metadata).

Goals

GoalBound toPurpose
stoatflow:configureinitialize (both profiles)Validates the memory settings and sets the image's environment (STOATFLOW_STATE_DIR, STOATFLOW_MEMORY_PROFILE, and STOATFLOW_HEAP_MB when heapMb is set), probes the docker executable (macOS), computes the reproducible creationTime, stages the effective native argfile, and validates mainClass.
stoatflow:copy-entrypointprepare-package (docker profile)Stages the container-aware heap entrypoint into target/jib-extra/app/.
stoatflow:native-docker-buildstandaloneStages the native build context (prebuilt JAR + argfile + Dockerfile.native + entrypoint) and runs the host-arch docker build.
stoatflow:runstandaloneForks a JVM with stoatflow.jvmArgs + your runtime classpath + mainClass.

Build commands

CommandResult
mvn packageCompiles + the fat JAR target/<name>-<version>-all.jar.
mvn -Pstoatflow-docker packageFat JAR and a Jib image to your local Docker daemon — one command.
mvn -Pstoatflow-native packageA GraalVM native binary via native-maven-plugin (host toolchain).
mvn stoatflow:native-docker-buildA native image built inside Docker from the prebuilt fat JAR (run mvn package first).
mvn stoatflow:runThe app in a forked JVM with the JVM args (stoatflow.jvmArgs).
Profiles are activated with -P, not POM <properties>. Maven <activation> reads system/user properties, not your project's <properties> — so a <stoatflow.docker.enabled> flag does not turn the build on. Activate with mvn -Pstoatflow-docker … (or -Dstoatflow.docker.enabled=true). The stoatflow-docker profile binds the Jib dockerBuild goal to package, which is why mvn -Pstoatflow-docker package is the whole image build.

Using just the BOM

If you don't want the parent POM (you already have a corporate parent, say), import the BOM directly for version alignment and configure the toolchain + flags yourself — the DIY path is in Installation → Option B:

<properties>
  <stoatflow.version>REPLACE-WITH-CURRENT-RELEASE</stoatflow.version>
</properties>

<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>io.stoatflow</groupId>
      <artifactId>stoatflow-bom</artifactId>
      <version>${stoatflow.version}</version>
      <type>pom</type>
      <scope>import</scope>
    </dependency>
  </dependencies>
</dependencyManagement>

Version compatibility

The parent pins the build plugins it uses. As of 1.0.0-rc.6 the pins are:

PluginVersion
Maven3.8+ (3.9.x recommended)
jib-maven-plugin3.5.2
native-maven-plugin1.1.20
maven-shade-plugin3.6.2
kotlin-maven-plugin2.4.21
maven-compiler-plugin3.16.0
surefire / failsafe3.6.1
exec-maven-plugin3.6.4
jib-maven-plugin (3.5.2) trails the jib-gradle-plugin (3.5.4) — that's their independent release cadence, not a defect; both produce equivalent images.