You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Christoph Läubrich (Jira)" <ji...@apache.org> on 2024/02/03 10:15:00 UTC

[jira] [Commented] (MCOMPILER-574) ‎AbstractCompilerMojo::execute should propagate exception cause

    [ https://issues.apache.org/jira/browse/MCOMPILER-574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17813901#comment-17813901 ] 

Christoph Läubrich commented on MCOMPILER-574:
----------------------------------------------

(y) exceptions should always carry the cause if they convert from one type to another! 

> ‎AbstractCompilerMojo::execute should propagate exception cause
> ---------------------------------------------------------------
>
>                 Key: MCOMPILER-574
>                 URL: https://issues.apache.org/jira/browse/MCOMPILER-574
>             Project: Maven Compiler Plugin
>          Issue Type: Improvement
>    Affects Versions: 3.12.1
>            Reporter: Alexander Kriegisch
>            Priority: Major
>
> [In {{‎AbstractCompilerMojo::execute}}|https://github.com/apache/maven-compiler-plugin/blob/c08b0fda5445a2a3f495a3d6524d80c82fc9d5e6/src/main/java/org/apache/maven/plugin/compiler/AbstractCompilerMojo.java#L680-L684], errors caught from the compiler manager are swallowed, instead a new {{MojoExecutionException}} is thrown. This renders debugging root causes for problems with compiler DI scanning, injection and instantiation virtually impossible.
> The caught exception should be passed on as a cause for the new exception.
> [~laeubi], see our discussion [here|https://github.com/codehaus-plexus/plexus-compiler/pull/361#discussion_r1477027270].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)