gnodet opened a new pull request, #12864: URL: https://github.com/apache/maven/pull/12864
## Summary In `mvnsh`, the `mvn`, `mvnenc`, and `mvnup` commands unconditionally logged an `[ERROR]` message when catching `InvokerException.ExitException`, even when the exit code was 0 (success). This produced confusing output like: ``` maven-buch mvnsh> mvn --version Apache Maven 4.0.0-rc-6 (...) ... [ERROR] mvn command exited with exit code 0 ``` The fix adds an `if (e.getExitCode() != 0)` guard before the error log in all three command methods, consistent with how the shell (`!`) command already handles exit codes at line 165 of the same file. The `ExitException` Javadoc explicitly states: *"Exception for intentional exit: No message or anything will be displayed, just the carried exit code will be returned."* — logging an ERROR on exit code 0 violated this contract. Fixes #12749 🤖 Generated with [Claude Code](https://claude.ai/code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
