[
https://issues.apache.org/jira/browse/MNG-8196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17872821#comment-17872821
]
ASF GitHub Bot commented on MNG-8196:
-------------------------------------
gnodet commented on code in PR #1628:
URL: https://github.com/apache/maven/pull/1628#discussion_r1713403466
##########
maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java:
##########
@@ -324,7 +325,8 @@ private void doExecute2(MavenSession session, MojoExecution
mojoExecution) throw
} catch (MojoFailureException
| PluginManagerException
| PluginConfigurationException
- | MojoExecutionException e) {
+ | MojoExecutionException
+ | MojoException e) {
Review Comment:
Should that one be a `MavenException` too given we've broaden the other
locations ?
> Make exception messages match Maven 3 again
> -------------------------------------------
>
> Key: MNG-8196
> URL: https://issues.apache.org/jira/browse/MNG-8196
> Project: Maven
> Issue Type: Improvement
> Components: Core
> Reporter: Tamas Cservenak
> Priority: Major
> Fix For: 4.0.0, 4.0.0-beta-4
>
>
> The boxing of `MojoException` into a `MojoExecutionException` brought two
> issues:
> 1. It added another layer to the stacktrace, making it a bit less readable
> for users and breaking test expectations for Maven extension authors (the
> latter was my main motivation for this change)
> 2. It lost the `longMessage`, which meant that this message was no longer
> shown at the end of the build.
> This change fixes both problems by passing through the original
> `MojoException` and treating this new exception type directly in
> `DefaultExceptionHandler` and `MojoExecutor`
--
This message was sent by Atlassian Jira
(v8.20.10#820010)