Fix Maven build output (#20491)

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2026-03-31 19:56:55 +02:00
committed by GitHub
parent 5891fe1d3f
commit 7dfe35bea0
+4 -4
View File
@@ -58,10 +58,10 @@ function mvnp() {
local padding=$(bc -l <<< "scale=0;2*(l($reactor_size)/l(10)+1)")
local command=(bash ./mvnw "$@")
"${command[@]}" 2>&1 | \ # execute, redirect stderr to stdout
tee "$BUILD_LOG" | \ # write output to log
stdbuf -oL grep -aE '^\[INFO\] Building .+ \[.+\]$' | \ # filter progress
stdbuf -o0 sed -uE 's/^\[INFO\] Building (.*[^ ])[ ]+\[([0-9]+\/[0-9]+)\]$/\2| \1/' | \ # prefix project name with progress
"${command[@]}" 2>&1 | # execute, redirect stderr to stdout
tee "$BUILD_LOG" | # write output to log
stdbuf -oL grep -aE '^\[INFO\] Building .+ \[.+\]$' | # filter progress
stdbuf -o0 sed -uE 's/^\[INFO\] Building (.*[^ ])[ ]+\[([0-9]+\/[0-9]+)\]$/\2| \1/' | # prefix project name with progress
stdbuf -o0 sed -e :a -e "s/^.\{1,${padding}\}|/ &/;ta" # right align progress with padding
# Exit code of Maven is the first command in the pipeline