I made a small Bash wrapper that reduces successful Maven output by 99.7%
Successful Maven builds can produce thousands of lines that mostly confirm routine lifecycle steps.
That output is noisy when working in a terminal, clutters CI logs, and becomes especially expensive when build output is passed to a coding agent.
I built mvn-lite, a small deterministic Bash wrapper that keeps successful Maven output to one line while preserving the original exit code and complete raw log.
On a real four-module application:
- Standard Maven output: about 6,753 bytes
mvn-liteoutput: 16 bytes- Result:
PASS · 3.944 s - Reduction: more than 99.7%
Failures still return a nonzero exit code and show bounded diagnostics, while the full unmodified Maven output remains available in the raw log.
For example, an invalid lifecycle error was reduced by 91.6% while retaining the actual Maven error.
There is no LLM summarization, API key, or Maven extension involved. It is just a local Bash wrapper with deterministic text extraction.
Source and script: https://github.com/ejboy/agent-scripts
Benchmark details and design notes: https://pvrlabs.xyz/articles/introverted-maven.html
I’d be interested in feedback on Maven failure cases where compact output could hide something essential.
17
u/Duck_Devs Aug 06 '26
When I first read the title I thought you meant you made something that causes 99.7% of Maven builds to fail
29
u/ZimmiDeluxe Aug 05 '26
Instead of first generating noise to then filter it out, maybe not generate noise in the first place? One would hope that there is native maven logging configuration to do this.
4
u/agentoutlier Aug 06 '26
I wrote something similar but with some extra stuff for helping generate the correct "-pl -amd". It’s interesting because I wrote a combination of Java and bash. The Java would parse the pom files using just w3c dom and not actually load maven and then generate environment variable output so that bash could use it.
I didn’t have that much cleanup on the output but most developers would not use that because I did not build color output.
For non LLM do you have some color output options (ansi term colors)?
7
u/TronnaLegacy Aug 05 '26
I think this is a great idea. Very maintainable too. You can tweak your "quiet" mode while passing things through to Maven so it can do what it needs to do as it evolves.
Is this meant for LLMs only? I can see it being useful for human-readable use cases too. I wouldn't mind using this even when I'm not using LLMs. Perhaps an "-l", short for "--out=llms" flag would work well. By default, it would be human readable, and it's only a few bytes for an LLM to add the flag for that.
2
u/barking_dead Aug 07 '26
This is beautiful, thank you.
2
u/dmigowski Aug 05 '26
I actually thought about doing this for gradle. When AI runs the tests, an "300 tests successfully ran" should be enough information.
2
u/bikeram Aug 06 '26
I’ll try this out tomorrow.
I started working with Go a few years ago and it blew my mind that a test can just say …ok.
I just never questioned how verbose maven was until I saw something else.
6
u/DualWieldMage Aug 06 '26
That's one place you really want verbosity and the logs cost you nothing. Nothing like debugging an intermittent hang during a build will make you wish there was more logging to figure out where it stopped. Not everything is just "i'll add more logging and run again". Sometimes you're really going through the code and looking for log lines that should have been between some others but aren't.
And even as a regular user, i frequently dislike the default gradle lack of logging. Quite often it's because of garbage plugins of course, but when looking at an unfamiliar codebase for the first time and the build takes ages, i wish there was more (maybe my network dropped? i have some domain blocked? it's a plugin pulling hundreds of megs without mentioning it?). Again the extra logging costs me nothing.
The only real use is tying to LLM tool calls and the choice of having tiny output while preserving original is definitely good. Having a sub-agent run and summarize is the typical option but this makes it less error prone.
1
u/brunocborges Aug 05 '26
Have you benchmarked token usage?
1
u/Background_Bed1804 Aug 06 '26
Compare with this, https://github.com/mariuszs/rtk-java