Skip to content

Commit

Permalink
[MSITE-987] Consistently log when skipping report goal execution
Browse files Browse the repository at this point in the history
This closes #162
  • Loading branch information
michael-o committed Oct 29, 2023
1 parent 6acdc6e commit fbf0596
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ under the License.
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-exec</artifactId>
<version>2.0.0-M11</version>
<version>2.0.0-M12-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,14 @@ protected List<MavenReportExecution> getReports() throws MojoExecutionException
// filter out reports that can't be generated
List<MavenReportExecution> reportExecutions = new ArrayList<>(allReports.size());
for (MavenReportExecution exec : allReports) {
String reportMojoInfo = exec.getPlugin().getId() + ":" + exec.getGoal();
try {
if (exec.canGenerateReport()) {
reportExecutions.add(exec);
} else if (exec.isUserDefined()) {
getLog().info("Skipping " + reportMojoInfo + " report");
}
} catch (MavenReportException e) {
String reportMojoInfo = exec.getPlugin().getId() + ":" + exec.getGoal();
throw new MojoExecutionException(
"Failed to determine whether report '" + reportMojoInfo + "' can be generated", e);
}
Expand Down

0 comments on commit fbf0596

Please sign in to comment.