gnodet commented on issue #12593:
URL: https://github.com/apache/maven/issues/12593#issuecomment-5457537018

   Closing as invalid after investigation.
   
   This is Maven's **intentional error-handling pattern**, not a bug.
   
   1. **The caller checks the result.** In `DefaultMaven.doExecute()`, 
immediately after `lifecycleStarter.execute(session)`, Maven checks 
`session.getResult().hasExceptions()`. If exceptions were collected, it adds 
them to the final result, persists resumption data, and returns with a failure 
indication.
   
   2. **There is a safety net above.** In `DefaultMaven.execute()`, if any 
RuntimeException somehow escapes `doExecute()`, it is caught and wrapped as an 
`InternalErrorException`.
   
   3. **This is the universal Maven pattern.** The entire `DefaultMaven` class 
uses the same approach: every exception throughout the build pipeline is added 
to `MavenExecutionResult`. This allows Maven to produce proper error reports, 
persist build resumption data, fire session-ended events, and exit cleanly 
rather than crashing with an unhandled stack trace.
   
   The exceptions are not swallowed — they are collected into a structured 
result object that drives Maven's error reporting and exit 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]

Reply via email to