mvnd
Maven Daemon 1.0+Quick reference for Maven Daemon (mvnd) — a long-lived JVM wrapper around `mvn` that keeps a background daemon to skip JVM startup on every build. Same CLI as Maven, plus daemon management commands.
29 commands
Daemon management
mvnd --statusList every running mvnd daemon: ID, JDK home, version, uptime, idle time, current/finished build count. Mirrors `mvnd --status -o plain` for scripting.
-o plain|json output format
mvnd --statusmvnd --stopStop a single idle daemon. Pass the daemon's ID shown by `--status`. Prompts for confirmation unless `-y` is supplied.
-y skip confirmation
mvnd --stop 7d3c4e5f-a1b2-4c3d-9e0f-1234567890abmvnd --stop-allShut down every running mvnd daemon. Useful before a JDK upgrade, before switching `JAVA_HOME`, or as a CI pre-step that always wants a cold start.
mvnd --stop-allmvnd --shutdownAlias for `--stop-all`. Same behavior; preferred in scripts that target mvnd 1.0+ explicitly.
mvnd --shutdownmvnd --versionPrint mvnd version, Java version of the launcher, and the version of Maven used to run the daemon. Confirms which daemon will be created or reused.
mvnd --versionmvnd --create-daemonForce-create a new daemon with the current JDK and Maven version instead of reusing one. Handy after a `JAVA_HOME` switch to avoid the old daemon holding stale class data.
--user <name> JVM config preset
mvnd --create-daemon clean installLifecycle phases (drop-in for mvn)
mvnd validateValidate the project: parse `pom.xml`, download snapshots, sanity-check dependencies. Identical to `mvn validate`.
mvnd validatemvnd compileCompile `src/main/java` into `target/classes`. With a warm daemon this is dramatically faster than `mvn compile` because the JIT has already optimized the plugins.
-DskipTests; -T 4 parallel threads (forwarded to mvn)
mvnd compilemvnd testRun Surefire unit tests. Tests still fork a fresh JVM, so test isolation is unchanged — the speedup is only on the Maven side.
-Dtest=ClassName; -Dtest=Class#method; -DfailIfNoTests=false
mvnd test -Dtest=UserServiceTestmvnd packageRun every prior phase and package the output into `target/*.jar` (or `.war`/`.ear`).
-DskipTests; -Dpackaging=jar
mvnd package -DskipTestsmvnd installRun verify, then copy the produced artifact into `~/.m2/repository/` so other local projects can depend on it.
mvnd install -DskipTestsmvnd clean installWipe `target/` then run through `install`. The standard "rebuild from scratch" command, but considerably faster under mvnd because the daemon survives `clean`.
-U force-update of snapshot dependencies
mvnd clean install -Umvnd deployBuild and push the artifact to the remote repository declared in `pom.xml`'s `<distributionManagement>`. Same semantics as `mvn deploy`.
-DskipTests; -P release use release profile
mvnd deploy -P release -DskipTestsDaemon tuning
mvnd -Dmvnd.daemonStorage=<path> <phase>Override the daemon registry directory (default `~/.m2/mvnd/`). Use a per-project path to give each worktree its own daemon pool.
mvnd -Dmvnd.daemonStorage=.mvnd clean installmvnd -Dmvnd.idleTimeout=<duration> <phase>Set how long a daemon can sit idle before auto-shutdown. Default 3h. Accepts `30s`, `5m`, `2h`, `1d`.
mvnd -Dmvnd.idleTimeout=30m testmvnd -Dmvnd.maxHeap=<size> <phase>Cap the daemon JVM heap. Default 2G. Lower to share RAM with other tools; raise if you see `OutOfMemoryError` during heavy multi-module builds.
mvnd -Dmvnd.maxHeap=4G clean installmvnd -Dmvnd.threads=<n> <phase>Maximum number of concurrent daemons mvnd will keep alive. Default = number of CPU cores. Set lower to reduce idle memory usage; set higher to allow different JDK/Maven combinations in parallel.
mvnd -Dmvnd.threads=2 testmvnd -Dmvnd.scheduler=simple|async <phase>Choose how the daemon is selected. `simple` (default) picks the most-recently-used daemon; `async` keeps one daemon per Maven/JDK combination and dispatches to the matching one. Use `async` when juggling multiple JDKs.
mvnd -Dmvnd.scheduler=async installBuild control (forwarded)
mvnd -DskipTests <phase>Skip running tests but still compile them. Same as mvn — mvnd forwards all `-D` system properties unchanged.
mvnd -DskipTests packagemvnd -T <n> <phase> / mvnd -T 1C <phase>Parallel reactor builds: `-T 4` for 4 threads, `-T 1C` for 1 thread per CPU core. Combined with mvnd's warm daemon, `-T 1C clean install` is the fastest possible full build.
mvnd -T 1C clean installmvnd -B -ntp <phase>Batch / non-interactive / no-transfer-progress. The recommended CI invocation — mvnd disables progress bars and ANSI colors so log parsers stay happy.
mvnd -B -ntp clean verifymvnd -X <phase>Debug logging. Prints every plugin execution and repository lookup. Pipe to file — output is large.
-e full stack traces on errors
mvnd -X test > mvnd-debug.log 2>&1mvnd -pl <module> -am <phase>Build one module plus everything it depends on. `-amd` (also-make-dependents) is the inverse. Identical to mvn flags.
mvnd -pl user-service -am testmvnd -s <settings.xml> <phase>Override `~/.m2/settings.xml` for this build. CI uses this to point at mirrored repos / release credentials.
mvnd -s ./.mvn/settings.xml deploymvnd -o <phase>Offline mode — fail if any artifact is missing from the local repo. mvnd forwards this flag unchanged; the daemon just does the resolution work itself.
mvnd -o testDiagnostics
mvnd --log <phase>Stream the daemon-side Maven build log into the foreground (it goes to `~/.m2/mvnd/<daemon-id>/daemon.log` by default). Useful for debugging daemon-only failures.
mvnd --log testmvnd --purgeDelete the entire daemon registry directory (`~/.m2/mvnd/` by default). After a JDK or Maven upgrade that changes byte layout, stale daemons can produce confusing errors — purge first.
mvnd --purgemvnd --helpList every mvnd-specific flag (the `--status` family). For the full Maven flag set (`-D`, `-P`, `-T`, `-pl`, etc.) see `mvn --help` — mvnd forwards all of them.
mvnd --helpWrapper
./mvnw <phase>Run a build through the Maven Wrapper. To use mvnd transparently, rename/symlink to `./mvndw` or configure `.mvn/maven.config` to invoke mvnd instead of mvn — see `mvn -Dmaven.wrapper mvnd` recipes.
./mvnw clean installRelated command cheatsheets
maven
Quick reference for Maven CLI commands: project lifecycle phases, dependency management, plugins, multi-module reactors, repository deployment, and debugging — with common options and practical examples.
34 commands
Maven 3.9+
gradle
Quick reference for the Gradle CLI: project tasks, dependency management, multi-project builds, wrapper, configuration cache, and build scan — with common options and practical examples.
30 commands
Gradle 8+
Trademark & Use Notice
These command-line tool cheatsheets are open community references. The names, logos, and trademarks of the tools referenced here (such as Git™, Docker™, Kubernetes®, kubectl, PostgreSQL®, MySQL®, Redis™, MongoDB®, Linux™, PowerShell™, Vim™, and others) are the property of their respective owners and are used here solely for identification and reference purposes.
All content in these cheatsheets is independently authored as a simplified, self-contained reference. It is not affiliated with, endorsed by, or sourced from any official documentation. Command listings, flag descriptions, and examples are original simplifications; for authoritative information please consult the official documentation of each tool.
Command syntax and option flags may differ across tool versions. The version tags shown reflect stable releases; behavior may differ in other versions. This cheatsheet does not imply any preference or recommendation by the trademark holders.
If a trademark or copyright owner believes that any content on this site infringes their rights, please send an email to [email protected]. Upon receiving valid proof of rights, we will modify or remove the relevant content within a reasonable period.
This website assumes no legal liability for any direct or indirect losses arising from the use of information presented on these pages.
About Maven Daemon
Apache Maven Daemon (mvnd) is a wrapper around the standard `mvn` CLI that keeps one or more long-lived JVM daemons in the background and dispatches builds to them. The project was created by Peter Palaga and the first stable release (1.0.0) shipped in 2024 after years of incubation at the Apache Software Foundation. mvnd reuses the same `pom.xml`, `~/.m2/repository`, plugins, and lifecycle phases as Maven 3.x, so it is a true drop-in replacement — `mvnd compile` behaves exactly like `mvn compile`, just faster. The speedup comes from three sources: (1) the JVM itself is started once and reused across builds (skipping the 1-3 second JVM startup tax that mvn pays on every invocation); (2) mvnd uses GraalVM as the JDK for the daemon process, which lowers warm-up time and RSS; and (3) it can run multiple module builds in parallel within a single daemon. Build speedups range from 2x on small single-module projects to 10x or more on large multi-module reactors with thousands of classes. mvnd writes its daemon registry under `~/.m2/mvnd/` (separate from the regular `~/.m2/repository/`) so multiple daemons can coexist with different JDKs. The daemon auto-shuts down after a configurable idle timeout (default 3 hours). All processing is local; no source code or artifacts are sent anywhere.
Cheatsheet version 1.0.0