You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Herve Boutemy (Jira)" <ji...@apache.org> on 2022/01/27 07:22:00 UTC

[jira] [Moved] (MSHARED-1032) API change: let canGenerateReport() throw an Exception

     [ https://issues.apache.org/jira/browse/MSHARED-1032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Herve Boutemy moved MNG-7393 to MSHARED-1032:
---------------------------------------------

        Key: MSHARED-1032  (was: MNG-7393)
    Project: Maven Shared Components  (was: Maven)

> API change: let canGenerateReport() throw an Exception
> ------------------------------------------------------
>
>                 Key: MSHARED-1032
>                 URL: https://issues.apache.org/jira/browse/MSHARED-1032
>             Project: Maven Shared Components
>          Issue Type: Improvement
>            Reporter: Benjamin Marwell
>            Priority: Major
>
> Hi everyone,
> the `{{{}AbstractReportMojo{}}}` declares a method `{{{}canGenerateReport(){}}}`.
> However, it is unable to throw any exceptions. Not even {{MojoExecutionEx}} or {{{}MavenReportEx{}}}, which is most unfortunate.
> It is being used twice:
> Once in {{execute() throws MojoExEx}}
> and in
> {{generate() throws MavenReportEx}} (and is called by execute()).
> This way, there is no way for reporting plugins to scan for files, because {{FileUtils::getFiles}} DOES throw a {{{}IOException{}}}, which then cannot be wrapped. However, the {{IOException}} from that method is useless anyway, because it is never declared in any methods it calls.
> Therefore please consider:
>  * Declaring any Exception on `{{{}canGenerateReports(){}}}`
>  * Removing the declared {{IOException}} in PlexusUtils ([PR exists|https://github.com/codehaus-plexus/plexus-utils/issues/180]) and Maven-Utils (issue: tbd).
> Thanks!
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)