Repository navigation
fix(maven): ignore generic build failure banners in log handler (#6870) - #6871
Merged
Merged
Conversation
squakez
reviewed
Oct 8, 2026
squakez
left a comment
Contributor
There was a problem hiding this comment.
I think we can make it simpler that this. We can just remove the "ErrorContains" condition and avoid checking the reason. In the future we will probably refactor this part, so, no need to put more logic there.
…pache#6870) Remove the ErrorContains assertion in TestRunAndLogErrorMvn to avoid asserting the specific failure reason string from Maven's failure banner, keeping the assertion focused on the error occurrence. Signed-off-by: Ankit raj sharma <ankitrajsharma666@gmail.com>
Ankitraj-sharma
force-pushed
the
fix/maven-log-error
branch
from
October 8, 2026 12:06
e7f01e7 to
b76a0a7
Compare
squakez
approved these changes
Oct 8, 2026
Contributor
|
Check failure happens in build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6870
Motivation
In newer runner images (and modern Maven 3.9+), Maven outputs the failure summary banner
[ERROR] BUILD FAILUREand divider lines[ERROR] ------------------------------------------------------------------------with log level ERROR rather than INFO.Because
pkg/util/command.go'sscanrecords the first non-empty error message returned byLogHandler, the generic banner"BUILD FAILURE"was permanently recorded as the command's error message, shadowing the actual informative failure reason that follows (e.g."The goal you specified requires a project to execute but there is no POM in this directory"). This causedTestRunAndLogErrorMvnto fail with:It also resulted in Maven failures in the builder (
pkg/builder/jib.go) reporting only"BUILD FAILURE: exit status 1"without the actionable error reason.Modifications
LogHandlerinpkg/util/maven/maven_log.goto ignore non-diagnostic Maven banners (BUILD FAILURE,BUILD ERROR), separator lines (---...), and execution summary timings (Total time:,Finished at:) so that the actual root cause message is returned to the caller.ERRORandFATALlevels consistently withnormalizeLog.pkg/util/maven/maven_log_test.go:TestRunAndLogErrorMvnifmvnis not present inPATH.TestLogHandlerverifying banner and separator filtering.TestLogHandlerMavenFailureSequenceverifying that the informative error is correctly extracted from the Maven 3.9+ failure stream.