Skip to content

[MSHARED-1032] API change: let MavenReport#canGenerateReport() throw an exception #40

Description

@jira-importer

Benjamin Marwell opened MSHARED-1032 and commented

Hi everyone,

the AbstractReportMojo in reporting-impl implements a method canGenerateReport() from reporting-api.

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 canGenerateReport()
  • Removing the declared IOException in PlexusUtils (PR exists) and Maven-Utils (issue: tbd).

Thanks!


Affects: maven-reporting-api-3.0

Issue Links:

  • MSHARED-1275 MavenReport#canGenerateReport() is invoked twice
    ("causes")
  • MSHARED-193 API change: let MavenReportRenderer#render() throw an exception

Remote Links:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions