HDPark95 opened a new pull request, #12750:
URL: https://github.com/apache/maven/pull/12750

   `helpOrVersionAndMayExit()` throws `InvokerException.ExitException(0)` for 
`--help` and `--version`, so a successful command reaches the shell's catch 
block exactly like a failing one. The `mvn`, `mvnenc` and `mvnup` handlers 
logged an error without looking at the code:
   
   ```
   mvnsh> mvn --version
   Apache Maven 4.0.0-rc-6 ...
   [ERROR] mvn command exited with exit code 0
   ```
   
   The three handlers now share `reportExitCode()`, which logs only a non-zero 
code.
   
   Two unit tests cover both branches. With the guard removed, 
`zeroExitCodeIsNotReported` fails on the exact message from the report; 
`impl/maven-cli` is green at 637 tests with checkstyle and spotless enabled.
   
   Fixes #12749
   


-- 
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]

Reply via email to