From c136254d5b326856fe5b3764f6d499e182ab57b2 Mon Sep 17 00:00:00 2001 From: Wouter Born Date: Mon, 5 Aug 2019 14:40:49 +0200 Subject: [PATCH] Fix empty reactor summary on newer Maven versions On newer Maven versions the reactor summary also contains the project name and version so the regexp needs to be adjusted for this. Also make sure grep treats binary data as text (-aE switch) so the pipe doesn't choke on this. Signed-off-by: Wouter Born --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a1b5fdb95..66357031c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,14 +25,14 @@ install: done } function print_reactor_summary() { - sed -ne '/\[INFO\] Reactor Summary:/,$ p' "$1" | sed 's/\[INFO\] //' + sed -ne '/\[INFO\] Reactor Summary.*:/,$ p' "$1" | sed 's/\[INFO\] //' } function mvnp() { set -o pipefail # exit build with error when pipes fail local command=(mvn $@) exec "${command[@]}" 2>&1 | # execute, redirect stderr to stdout tee .build.log | # write output to log - stdbuf -oL grep -E '^\[INFO\] Building .+ \[.+\]$' | # filter progress + stdbuf -oL grep -aE '^\[INFO\] Building .+ \[.+\]$' | # filter progress sed -uE 's/^\[INFO\] Building (.*[^ ])[ ]+\[([0-9]+\/[0-9]+)\]$/\2| \1/' | # prefix project name with progress sed -e :a -e 's/^.\{1,6\}|/ &/;ta' & # right align progress with padding local pid=$!