Sounds like a good improvement.

On a related note, we also have
http://issues.apache.org/jira/projects/MNG/issues/MNG-7351 for which I
think the outcome of the discussion at
https://github.com/apache/maven/pull/632 leads to the fact that both
exceptions are handled the same, so we should simply deprecate one of the
exceptions.

Guillaume

Le mer. 26 janv. 2022 à 20:38, Benjamin Marwell <[email protected]> a
écrit :

> Hi everyone,
>
> I would like to change the API from the ReportMojo.
>
> I was recently looking at
>
> https://github.com/apache/maven-reporting-impl/blob/9050da0e7c2defed851621b62c0160b52716ba11/src/main/java/org/apache/maven/reporting/AbstractMavenReport.java#L338-L342
>
> But it seems the method boolean canGenerate() does not throw any
> exceptions.
> OTOH I see that a lot of reports are scanning for files and have to
> (possibly) deal with IOExceptions at some point, either via
> Files.walk() or FileUtils.getFiles().
>
> Sadly, we cannot just wrap them into a MojoExecutionException or
> MavenReportException, because both are not thrown from that method,
> AND the method canGenerate is called from two locations.So, what is
> the recommended approach, if canGenerate encounters an IOException?
>
> For this reason, I would like to introduce this API change:
> https://issues.apache.org/jira/browse/MNG-7393
>
> Thanks,,
> Ben
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

-- 
------------------------
Guillaume Nodet

Reply via email to