diff --git a/maven-plugin-plugin/src/site/markdown/index.md b/maven-plugin-plugin/src/site/markdown/index.md index 0ea1f957b..e56b67cd7 100644 --- a/maven-plugin-plugin/src/site/markdown/index.md +++ b/maven-plugin-plugin/src/site/markdown/index.md @@ -32,10 +32,10 @@ The Maven Plugin Plugin is used to create a [Maven plugin descriptor](/ref/curre The Plugin Plugin has four goals: -- [plugin:descriptor](./descriptor-mojo.html) generates a plugin descriptor, -- [plugin:addPluginArtifactMetadata](./addPluginArtifactMetadata-mojo.html) injects any plugin-specific artifact metadata to the project's artifact, for subsequent installation and deployment, -- [plugin:helpmojo](./helpmojo-mojo.html) generates a help mojo which describes all mojos in a plugin, -- [plugin:help](./help-mojo.html) display help information on maven-plugin-plugin. +- [plugin:descriptor](./descriptor-goal.html) generates a plugin descriptor, +- [plugin:addPluginArtifactMetadata](./addPluginArtifactMetadata-goal.html) injects any plugin-specific artifact metadata to the project's artifact, for subsequent installation and deployment, +- [plugin:helpmojo](./helpmojo-goal.html) generates a help mojo which describes all mojos in a plugin, +- [plugin:help](./help-goal.html) display help information on maven-plugin-plugin. ## Usage General instructions on how to use the Plugin Plugin can be found on the [usage page](./usage.html). Some more specific use cases are described in the examples given below. Last but not least, users occasionally contribute additional examples, tips or errata to the [Plugin Developers Centre page](https://maven.apache.org/plugin-developers/index.html). diff --git a/maven-plugin-report-plugin/src/it/fix-maven-since-3.x/verify.groovy b/maven-plugin-report-plugin/src/it/fix-maven-since-3.x/verify.groovy index 62a67dbbb..6cbdb870c 100644 --- a/maven-plugin-report-plugin/src/it/fix-maven-since-3.x/verify.groovy +++ b/maven-plugin-report-plugin/src/it/fix-maven-since-3.x/verify.groovy @@ -17,7 +17,7 @@ * under the License. */ -File touchFile = new File( basedir, "javasample-maven-plugin/target/site/touch-mojo.html" ) +File touchFile = new File( basedir, "javasample-maven-plugin/target/site/touch-goal.html" ) assert touchFile.exists() assert touchFile.isFile() content = touchFile.text diff --git a/maven-plugin-report-plugin/src/it/mplugin-191/verify.groovy b/maven-plugin-report-plugin/src/it/mplugin-191/verify.groovy index 24506b919..3647b22d7 100644 --- a/maven-plugin-report-plugin/src/it/mplugin-191/verify.groovy +++ b/maven-plugin-report-plugin/src/it/mplugin-191/verify.groovy @@ -18,7 +18,7 @@ File pluginInfo = new File( basedir, "target/site/plugin-info.html" ); assert pluginInfo.isFile() -File touchMojo = new File( basedir, "target/site/touch-mojo.html" ); +File touchMojo = new File( basedir, "target/site/touch-goal.html" ); assert touchMojo.isFile() return true; diff --git a/maven-plugin-report-plugin/src/it/mplugin-319_report-since/verify.groovy b/maven-plugin-report-plugin/src/it/mplugin-319_report-since/verify.groovy index 877d8f83b..011e4757f 100644 --- a/maven-plugin-report-plugin/src/it/mplugin-319_report-since/verify.groovy +++ b/maven-plugin-report-plugin/src/it/mplugin-319_report-since/verify.groovy @@ -16,9 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -assert new File( basedir, 'target/site/noop-mojo.html' ).exists() +assert new File( basedir, 'target/site/noop-goal.html' ).exists() -content = new File( basedir, 'target/site/noop-mojo.html' ).text +content = new File( basedir, 'target/site/noop-goal.html' ).text assert content.contains( '
1.0.-${project.build.directory}/generated-site/xdoc${project.build.directory}/generated-site/xdocplugin-info.html,
- * and one goal-mojo.html per goal.
- * Relies on one output file from plugin:descriptor.
+ * and one goal-goal.html per goal.
+ * Relies on one output file from plugin:descriptor.
*
* @since 3.14.0
*/
diff --git a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java
index 9b810ca15..6c5aea473 100644
--- a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java
+++ b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginOverviewRenderer.java
@@ -130,7 +130,7 @@ private void renderGoalsSection(boolean hasMavenReport) {
* Added ./ to define a relative path
* @see AbstractMavenReportRenderer#getValidHref(java.lang.String)
*/
- String goalDocumentationLink = "./" + mojo.getGoal() + "-mojo.html";
+ String goalDocumentationLink = "./" + mojo.getGoal() + "-goal.html";
sink.tableCell();
link(goalDocumentationLink, goalName);
sink.tableCell_();
diff --git a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java
index ac1ccdcb5..59e23db2b 100644
--- a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java
+++ b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginReport.java
@@ -23,6 +23,7 @@
import java.io.File;
import java.io.IOException;
import java.io.Reader;
+import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Collections;
@@ -63,8 +64,8 @@
/**
* Generates the plugin's report: the plugin details page at plugin-info.html
- * and one goal-mojo.html per goal.
- * Relies on one output file from plugin:descriptor.
+ * and one goal-goal.html per goal.
+ * Relies on one output file from plugin:descriptor.
*
* @author Stephane Nicoll
* @author Vincent Siveton
@@ -82,6 +83,14 @@ public class PluginReport extends AbstractMavenReport {
@Parameter(defaultValue = "false", property = "maven.plugin.report.skip")
private boolean skip;
+ /**
+ * Set this to {@code false} to stop generating compatibility pages using the legacy {@code -mojo.html} suffix.
+ *
+ * @since 4.0.0
+ */
+ @Parameter(defaultValue = "true", property = "maven.plugin.report.generateLegacyMojoReports")
+ private boolean generateLegacyMojoReports;
+
/**
* Set this to "true" to generate the usage section for "plugin-info.html" with
* {@code This page moved to " + + filename + + ".
\n"; + try { + Files.write( + new File(getReportOutputDirectory(), goal + "-mojo.html").toPath(), + redirect.getBytes(StandardCharsets.UTF_8)); + } catch (IOException e) { + throw new MavenReportException("Cannot generate legacy page for goal " + goal, e); + } + } + private List