Installation

Add the private StoatFlow Maven repository, pull the dependency, and set up your Gradle or Maven build.

This guide gets your build ready to use StoatFlow: wire up the private Maven repository with your credentials, add the dependency, and configure the JVM toolchain. Then configure your license and build your first app.

Prerequisites

  • JDK 25 or newer. StoatFlow uses JDK preview features (virtual threads, structured concurrency), so a 25+ toolchain is mandatory — not just for building, but at runtime.
  • Apache Kafka 4.x, reachable from where you run the app. For local development the quickest option is a single-node KRaft broker via Docker (localhost:9092).
  • Your onboarding email. It contains your read-only Maven token (username customer-<your-slug> + secret) and your license key. Don't have one yet? Get in touch.
Treat the Maven token and license key as secrets. The steps below keep them in your home directory (~/.gradle/gradle.properties, ~/.m2/settings.xml), never in a file you commit.

1. Register the private Maven repository

StoatFlow artifacts are served from a private, authenticated repository at https://maven.stoatflow.io/releases. You can wire it up two ways — directly on each developer machine (below), or once through your corporate artifact manager.

Corporate environments — proxy it through your artifact manager.If your organisation runs a central repository (JFrog Artifactory, Sonatype Nexus, or similar), add https://maven.stoatflow.io/releases as a remote / proxy repository and surface it through the virtual (group) repository your developers already resolve against. That way:
  • your StoatFlow token is configured once, centrally — never copied onto individual machines;
  • developers need no local credentials and no build changes — they resolve through the corporate repo exactly as they do today;
  • dependencies (and the io.stoatflow Gradle plugin) pull through and cache via the proxy, with authentication handled there.
Trial vs. production: the per-developer setup below is the fastest way to start a trial. Once you've agreed a contract and are moving toward production, switch to the corporate-proxy setup.

Store your credentials

# ~/.gradle/gradle.properties   — your HOME dir, never committed
stoatflowRepoUser=customer-your-slug
stoatflowRepoToken=PASTE_YOUR_MAVEN_TOKEN_FROM_THE_ONBOARDING_EMAIL

Point your build at the repository

// settings.gradle.kts
dependencyResolutionManagement {
    repositories {
        mavenCentral()
        maven {
            url = uri("https://maven.stoatflow.io/releases")
            credentials {
                username = providers.gradleProperty("stoatflowRepoUser").get()
                password = providers.gradleProperty("stoatflowRepoToken").get()
            }
        }
    }
}

The <id> in pom.xml must match the <server><id> in settings.xml — that's how Maven applies your credentials.

2. Add the dependency

Most applications want stoatflow-runtime — the batteries-included wrapper (YAML config, HTTP admin + health endpoints, Prometheus metrics, graceful shutdown). It transitively pulls in stoatflow-core, so it's the only dependency you need. If you want just the DSL and engine with no runtime scaffolding, depend on stoatflow-core instead.

// build.gradle.kts
dependencies {
    implementation("io.stoatflow:stoatflow-runtime:<stoatflow-version>")
    // ...or DSL only:
    // implementation("io.stoatflow:stoatflow-core:<stoatflow-version>")

    // In-memory topology testing (no broker required):
    testImplementation("io.stoatflow:stoatflow-test-utils:<stoatflow-version>")
}
StoatFlow is in alpha. The current version is 1.0.0-alpha.16 — substitute it for the <stoatflow-version> placeholder (Gradle) or set it as <stoatflow.version> in your pom.xml<properties> (Maven), or use the exact version from your onboarding email if it differs. The published modules are stoatflow-core, stoatflow-runtime, stoatflow-test-utils, and stoatflow-test-runtime, all under group io.stoatflow.

3. Configure the JVM toolchain

StoatFlow needs a JDK 25 toolchain and two JVM flags at both compile and run time:

  • --enable-preview — StoatFlow is built on JDK preview features.
  • --enable-native-access=ALL-UNNAMED — RocksDB's state store uses the Foreign Function & Memory API.
  • -XX:+UseG1GC keeps GC pauses short and predictable — which matters for stream processing, where a long stop-the-world pause stalls commit barriers and inflates end-to-end latency. The JVM only auto-selects G1 on "server-class" hardware (≥ 2 CPUs and ≥ ~2 GB of memory), falling back to the single-threaded Serial collector below that — so set it explicitly to get consistent pause behaviour even on a single core or a small container. (The StoatFlow build conventions already apply this flag to the local run task and to the Docker image they build.)

StoatFlow ships build conventions for both Gradle and Maven — the JDK 25 toolchain, the preview + native-access JVM args (compile, test, and run), and a runnable fat JAR — so you don't hand-maintain any of it. This page covers just the toolchain setup; the full walkthrough (container images, native image, every knob) is in Project setup.

Gradle — the io.stoatflow plugin

Add a pluginManagement repository for the plugin marker in settings.gradle.kts:

// settings.gradle.kts
pluginManagement {
    repositories {
        gradlePluginPortal()
        mavenCentral()
        maven {
            url = uri("https://maven.stoatflow.io/releases")
            credentials {
                username = providers.gradleProperty("stoatflowRepoUser").get()
                password = providers.gradleProperty("stoatflowRepoToken").get()
            }
        }
    }
}

Then apply it in build.gradle.kts:

// build.gradle.kts
plugins {
    kotlin("jvm") version "2.4.0"   // omit for a Java-only project
    id("io.stoatflow") version "<stoatflow-version>"
}

stoatflow {
    mainClass.set("com.example.MainKt")  // your application entry point
}

Maven — the stoatflow-parent POM

Inherit from the parent POM; it applies the toolchain, the JVM flags, the fat JAR, and the test split. Your dependency's version comes from the bundled BOM, 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>

See the Maven reference for the BOM, every property, and the container + native builds.

Option B — configure it yourself

If you'd rather not use the plugin, set the toolchain and JVM args directly:

// build.gradle.kts — with the `application` plugin applied
java {
    toolchain { languageVersion = JavaLanguageVersion.of(25) }
}
tasks.withType<JavaCompile> { options.compilerArgs.add("--enable-preview") }

application {
    applicationDefaultJvmArgs = listOf(
        "--enable-preview",
        "--enable-native-access=ALL-UNNAMED",
        "-XX:+UseG1GC",
    )
}

Next steps

  • License configuration — every license env var / system property / YAML key, for local development and CI/CD.
  • Your first app — build and run a complete word-count app on the runtime.
  • Architecture — the single-instance model, lane dispatcher, and commit barriers.
  • Stuck? Get in touch — real people read every email during the alpha.