mvnx
Maven wrapper written in Rust that provides clean and readable output for multi-module projects.
Features
- Clean output: Shows only essential information
- Reactor build order: Shows the order modules are built in
- Progress indicator: Shows which module is being built currently
- Build summary: Shows:
- Reactor build order
- Module status (OK/FAIL) with time spent
- Overall build status and total time spent
- Test failure details: Shows stacktraces for failed tests (from both
.txtand XML reports) - XML-based error parsing: Parses Maven Surefire XML reports for detailed error messages
- Dad jokes: Optional humor during the build
- Clipboard copying: Copies stacktraces to clipboard automatically
Usage
The wrapper takes the same arguments as mvn:
# Basic build
# Skip tests
# Specific goal
# Custom settings
Special flags
-h, --help: Show help message--mvnhelp: Show Maven's help message (mvn --help)-l, --log-file <file>: Write all Maven output to the specified file--clip: Copy stacktrace to clipboard when exactly one test fails-j: Show dad jokes every 30 seconds during the build-ji <seconds>: Show dad jokes with custom interval (implies-j)
Examples:
Output Example
> Building module-a
> Building module-b
================================================================================
BUILD SUMMARY
================================================================================
Reactor Build Order:
1. module-a
2. module-b
Module Status:
OK module-a [2.34s]
OK module-b [5.67s]
Overall Status: OK SUCCESS
Total Time: 8.01s
Tests: 45 run, 43 passed, 2 failed
================================================================================
TEST FAILURES
================================================================================
[module-b]
java.lang.AssertionError: Expected 42 but got 41
at TestFailureTest.testSomething(TestFailureTest.java:15)
Stacktrace copied to clipboard.
Testing
Run unit tests:
The tests cover:
- Parsing reactor modules from Maven output
- Parsing module build start lines
- Parsing test result summaries
- Filtering stacktraces (removes framework lines, keeps user code)
- Parsing Maven Surefire XML reports for error messages and errors
Installation
From crates.io (recommended)
This installs the latest release directly to your Cargo bin directory (typically ~/.cargo/bin).
Pre-built releases
Download pre-built binaries from the GitHub releases page and add to your PATH:
# Download, extract, and install
Build from source
Clone the repository and build:
The binary will be at ./target/release/mvnx.
Add custom build to PATH
If you built from source or want to use a custom location:
# or
Then use it:
How it works
The wrapper:
- Starts Maven as a subprocess
- Captures and parses its stdout output
- Extracts key information:
- Reactor module order
- Module build progress
- Build completion status and time spent
- Test failure information
- Parses Maven Surefire reports:
- Reads
.txtfiles for summaries - Reads
TEST-*.xmlfiles for detailed stacktraces and error messages - Filters out framework-related stacktrace lines
- Reads
- Shows a clean summary with error details
- Exits with Maven's exit code
Requirements
- Maven installed and available in PATH
- A clipboard tool:
wl-copy(Wayland)xclip(X11)pbcopy(macOS)
Limitations
- Optimized for standard Maven output format
- Test failure parsing may need adjustment based on your test framework
- Requires
mvninstalled and in PATH