From 8d5a603fd1c573ec1b8961b16b48780feb213d84 Mon Sep 17 00:00:00 2001 From: Rohit Bhardwaj Date: Tue, 7 Oct 2025 19:10:30 +0530 Subject: [PATCH] Architectural refactor: updated plugin report output from *-mojo.html to *-goal.html across generation logic, integration tests, and documentation templates. Closes #949 --- maven-plugin-plugin/src/site/apt/index.apt | 8 ++++---- .../src/it/fix-maven-since-3.x/verify.groovy | 2 +- .../src/it/mplugin-191/verify.groovy | 2 +- .../src/it/mplugin-319_report-since/verify.groovy | 4 ++-- .../src/it/mplugin-394_report-encoding/verify.groovy | 2 +- .../src/it/plugin-no-fork-report/verify.groovy | 6 +++--- .../verify.groovy | 2 +- .../it/plugin-report-requirements-history/verify.groovy | 2 +- .../src/it/plugin-report-with-javadoc-links/verify.groovy | 2 +- .../src/it/plugin-report/verify.groovy | 6 +++--- .../maven/plugin/plugin/report/PluginNoForkReport.java | 4 ++-- .../plugin/plugin/report/PluginOverviewRenderer.java | 2 +- .../apache/maven/plugin/plugin/report/PluginReport.java | 6 +++--- maven-plugin-report-plugin/src/site/apt/index.apt | 4 ++-- .../annotations/converter/JavaClassConverterContext.java | 2 +- .../converter/JavaClassConverterContextTest.java | 2 +- 16 files changed, 28 insertions(+), 28 deletions(-) diff --git a/maven-plugin-plugin/src/site/apt/index.apt b/maven-plugin-plugin/src/site/apt/index.apt index 371d7734..023c8e21 100644 --- a/maven-plugin-plugin/src/site/apt/index.apt +++ b/maven-plugin-plugin/src/site/apt/index.apt @@ -36,14 +36,14 @@ Maven Plugin Plugin The Plugin Plugin has four goals: - * {{{./descriptor-mojo.html}plugin:descriptor}} generates a plugin descriptor, + * {{{./descriptor-goal.html}plugin:descriptor}} generates a plugin descriptor, - * {{{./addPluginArtifactMetadata-mojo.html}plugin:addPluginArtifactMetadata}} injects any plugin-specific artifact + * {{{./addPluginArtifactMetadata-goal.html}plugin:addPluginArtifactMetadata}} injects any plugin-specific artifact metadata to the project's artifact, for subsequent installation and deployment, - * {{{./helpmojo-mojo.html}plugin:helpmojo}} generates a help mojo which describes all mojos in a plugin, + * {{{./helpmojo-goal.html}plugin:helpmojo}} generates a help mojo which describes all mojos in a plugin, - * {{{./help-mojo.html}plugin:help}} display help information on maven-plugin-plugin. + * {{{./help-goal.html}plugin:help}} display help information on maven-plugin-plugin. [] 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 62a67dbb..6cbdb870 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 24506b91..3647b22d 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 877d8f83..8335191e 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( '
  • Since version: 1.0.
  • ' ) assert content.contains( '-' ) diff --git a/maven-plugin-report-plugin/src/it/mplugin-394_report-encoding/verify.groovy b/maven-plugin-report-plugin/src/it/mplugin-394_report-encoding/verify.groovy index e10b6308..b4f10e2d 100644 --- a/maven-plugin-report-plugin/src/it/mplugin-394_report-encoding/verify.groovy +++ b/maven-plugin-report-plugin/src/it/mplugin-394_report-encoding/verify.groovy @@ -17,7 +17,7 @@ * under the License. */ -generated = new File( basedir, "target/site/test-mojo.html").getText("UTF-8") +generated = new File( basedir, "target/site/test-goal.html").getText("UTF-8") assert generated.contains("Mojo-Description with some non-ASCII characters: €àáâãäåæòóôõöø") assert generated.contains("Parameter-Description with some non-ASCII characters: ÈÉÊË€") diff --git a/maven-plugin-report-plugin/src/it/plugin-no-fork-report/verify.groovy b/maven-plugin-report-plugin/src/it/plugin-no-fork-report/verify.groovy index d7d173b2..77760125 100644 --- a/maven-plugin-report-plugin/src/it/plugin-no-fork-report/verify.groovy +++ b/maven-plugin-report-plugin/src/it/plugin-no-fork-report/verify.groovy @@ -17,8 +17,8 @@ * under the License. */ -assert new File( basedir, 'target/site/noop-mojo.html' ).isFile() -assert new File( basedir, 'target/site/report-mojo.html' ).isFile() +assert new File( basedir, 'target/site/noop-goal.html' ).isFile() +assert new File( basedir, 'target/site/report-goal.html' ).isFile() def pluginInfo = new File( basedir, 'target/site/plugin-info.html' ) assert pluginInfo.isFile() @@ -34,7 +34,7 @@ assert pluginInfo.text.contains('
    Deprecated. You don\'t us assert pluginInfo.text.contains('Does nothing.') -def noopMojo = new File( basedir, 'target/site/noop-mojo.html' ) +def noopMojo = new File( basedir, 'target/site/noop-goal.html' ) assert noopMojo.isFile() // deprecated in table and details diff --git a/maven-plugin-report-plugin/src/it/plugin-report-detect-requirements-history/verify.groovy b/maven-plugin-report-plugin/src/it/plugin-report-detect-requirements-history/verify.groovy index f1ce27a1..fe6158f0 100644 --- a/maven-plugin-report-plugin/src/it/plugin-report-detect-requirements-history/verify.groovy +++ b/maven-plugin-report-plugin/src/it/plugin-report-detect-requirements-history/verify.groovy @@ -17,7 +17,7 @@ * under the License. */ -assert new File( basedir, 'target/site/noop-mojo.html' ).isFile() +assert new File( basedir, 'target/site/noop-goal.html' ).isFile() def pluginInfo = new File( basedir, 'target/site/plugin-info.html' ) assert pluginInfo.isFile() diff --git a/maven-plugin-report-plugin/src/it/plugin-report-requirements-history/verify.groovy b/maven-plugin-report-plugin/src/it/plugin-report-requirements-history/verify.groovy index d573e5e6..e7da231a 100644 --- a/maven-plugin-report-plugin/src/it/plugin-report-requirements-history/verify.groovy +++ b/maven-plugin-report-plugin/src/it/plugin-report-requirements-history/verify.groovy @@ -17,7 +17,7 @@ * under the License. */ -assert new File( basedir, 'target/site/noop-mojo.html' ).isFile() +assert new File( basedir, 'target/site/noop-goal.html' ).isFile() def pluginInfo = new File( basedir, 'target/site/plugin-info.html' ) assert pluginInfo.isFile() diff --git a/maven-plugin-report-plugin/src/it/plugin-report-with-javadoc-links/verify.groovy b/maven-plugin-report-plugin/src/it/plugin-report-with-javadoc-links/verify.groovy index 158ea3e8..e470fb64 100644 --- a/maven-plugin-report-plugin/src/it/plugin-report-with-javadoc-links/verify.groovy +++ b/maven-plugin-report-plugin/src/it/plugin-report-with-javadoc-links/verify.groovy @@ -17,7 +17,7 @@ * under the License. */ -def mojoDoc = new File( basedir, 'target/site/test-mojo.html' ) +def mojoDoc = new File( basedir, 'target/site/test-goal.html' ) assert mojoDoc.isFile() diff --git a/maven-plugin-report-plugin/src/it/plugin-report/verify.groovy b/maven-plugin-report-plugin/src/it/plugin-report/verify.groovy index ea819a14..7c272373 100644 --- a/maven-plugin-report-plugin/src/it/plugin-report/verify.groovy +++ b/maven-plugin-report-plugin/src/it/plugin-report/verify.groovy @@ -17,8 +17,8 @@ * under the License. */ -assert new File( basedir, 'target/site/noop-mojo.html' ).isFile() -assert new File( basedir, 'target/site/report-mojo.html' ).isFile() +assert new File( basedir, 'target/site/noop-goal.html' ).isFile() +assert new File( basedir, 'target/site/report-goal.html' ).isFile() def pluginInfo = new File( basedir, 'target/site/plugin-info.html' ) assert pluginInfo.isFile() @@ -34,7 +34,7 @@ assert pluginInfo.text.contains('
    Deprecated. You don\'t us assert pluginInfo.text.contains('Does nothing.') -def noopMojo = new File( basedir, 'target/site/noop-mojo.html' ) +def noopMojo = new File( basedir, 'target/site/noop-goal.html' ) assert noopMojo.isFile() // deprecated in table and details diff --git a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginNoForkReport.java b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginNoForkReport.java index 8b546697..ebbbb00d 100644 --- a/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginNoForkReport.java +++ b/maven-plugin-report-plugin/src/main/java/org/apache/maven/plugin/plugin/report/PluginNoForkReport.java @@ -24,8 +24,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. * * @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 9b810ca1..6c5aea47 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 cc260b7d..5a6b4e25 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 @@ -62,8 +62,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 @@ -276,7 +276,7 @@ private void generateMojosDocumentation(PluginDescriptor pluginDescriptor, Local for (MojoDescriptor descriptor : pluginDescriptor.getMojos()) { GoalRenderer renderer; try { - String filename = descriptor.getGoal() + "-mojo.html"; + String filename = descriptor.getGoal() + "-goal.html"; Sink sink = getSinkFactory().createSink(getReportOutputDirectory(), filename); renderer = new GoalRenderer( sink, diff --git a/maven-plugin-report-plugin/src/site/apt/index.apt b/maven-plugin-report-plugin/src/site/apt/index.apt index 24117bbc..8c431102 100644 --- a/maven-plugin-report-plugin/src/site/apt/index.apt +++ b/maven-plugin-report-plugin/src/site/apt/index.apt @@ -34,9 +34,9 @@ Maven Plugin Report Plugin The Plugin Report Plugin has two goals: - * {{{./report-mojo.html}plugin-report:report}} which generates the plugin documentation: one overview report and documentation for each plugin's goal (mojo). + * {{{./report-goal.html}plugin-report:report}} which generates the plugin documentation: one overview report and documentation for each plugin's goal (mojo). - * {{{./report-no-fork-mojo.html}plugin-report:report-no-fork}} which generates the plugin documentation: one overview report and documentation for each plugin's goal (mojo) without forking the <<>> phase again. Note that this goal does require generation of classes before site generation, e.g. by invoking <<>>. + * {{{./report-no-fork-goal.html}plugin-report:report-no-fork}} which generates the plugin documentation: one overview report and documentation for each plugin's goal (mojo) without forking the <<>> phase again. Note that this goal does require generation of classes before site generation, e.g. by invoking <<>>. [] diff --git a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/converter/JavaClassConverterContext.java b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/converter/JavaClassConverterContext.java index b039d5b4..919619e6 100644 --- a/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/converter/JavaClassConverterContext.java +++ b/maven-plugin-tools-annotations/src/main/java/org/apache/maven/tools/plugin/extractor/annotations/converter/JavaClassConverterContext.java @@ -170,7 +170,7 @@ public URI getUrl(FullyQualifiedJavadocReference reference) { // link to other mojo (only for fields = parameters or without member) return new URI( null, - "./" + mojoAnnotatedClass.getMojo().name() + "-mojo.html", + "./" + mojoAnnotatedClass.getMojo().name() + "-goal.html", reference.getMember().orElse(null)); } } diff --git a/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/converter/JavaClassConverterContextTest.java b/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/converter/JavaClassConverterContextTest.java index 55030a96..4165f418 100644 --- a/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/converter/JavaClassConverterContextTest.java +++ b/maven-plugin-tools-annotations/src/test/java/org/apache/maven/tools/plugin/extractor/annotations/converter/JavaClassConverterContextTest.java @@ -235,7 +235,7 @@ void testGetUrl() throws URISyntaxException { // field reference in another mojo assertEquals( - new URI(null, "./other-goal-mojo.html", "field1"), + new URI(null, "./other-goal-goal.html", "field1"), context.getUrl(new FullyQualifiedJavadocReference( currentPackageName, "OtherClass", "field1", MemberType.FIELD, false)));