Skip to content

Commit

Permalink
[MPLUGIN-493] Consistently evaluate skip parameter in MavenReport#can…
Browse files Browse the repository at this point in the history
…GenerateReport()
  • Loading branch information
michael-o committed Nov 12, 2023
1 parent b8ba9ef commit 104b261
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,18 @@ protected MavenProject getProject() {
* {@inheritDoc}
*/
public boolean canGenerateReport() {
if (skip || skipReport) {
getLog().info("Maven Plugin Plugin Report generation skipped.");
return false;
}

return true;
}

/**
* {@inheritDoc}
*/
protected void executeReport(Locale locale) throws MavenReportException {
if (!canGenerateReport()) {
return;
}
if (skip || skipReport) {
getLog().info("Maven Plugin Plugin Report generation skipped.");
return;
}

// Generate the plugin's documentation
generatePluginDocumentation(locale);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,16 @@ protected MavenProject getProject() {

/** {@inheritDoc} */
public boolean canGenerateReport() {
if (skip || skipReport) {
getLog().info("Maven Plugin Plugin Report generation skipped.");
return false;
}

return true;
}

/** {@inheritDoc} */
protected void executeReport(Locale locale) throws MavenReportException {
if (!canGenerateReport()) {
return;
}
if (skip || skipReport) {
getLog().info("Maven Plugin Plugin Report generation skipped.");
return;
}

// Generate the plugin's documentation
generatePluginDocumentation(locale);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,23 @@ public class PluginReport extends AbstractMavenReport {
*/
@Override
public boolean canGenerateReport() {
return enhancedPluginXmlFile != null && enhancedPluginXmlFile.isFile() && enhancedPluginXmlFile.canRead();
if (skip) {
getLog().info("Maven Plugin Plugin Report generation skipped.");
return false;
}

if (!(enhancedPluginXmlFile != null && enhancedPluginXmlFile.isFile() && enhancedPluginXmlFile.canRead())) {
return false;
}

return true;
}

/**
* {@inheritDoc}
*/
@Override
protected void executeReport(Locale locale) throws MavenReportException {
if (skip) {
getLog().info("Maven Plugin Plugin Report generation skipped.");
return;
}

PluginDescriptor pluginDescriptor = extractPluginDescriptor();

// Generate the mojos' documentation
Expand Down

0 comments on commit 104b261

Please sign in to comment.