You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sj...@apache.org on 2022/07/04 19:52:36 UTC

[maven-plugin-tools] branch master updated: [MPLUGIN-402] optionally render true in usage section

This is an automated email from the ASF dual-hosted git repository.

sjaranowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-plugin-tools.git


The following commit(s) were added to refs/heads/master by this push:
     new affaa0e5 [MPLUGIN-402] optionally render <extensions>true</extensions> in usage section
affaa0e5 is described below

commit affaa0e59ac069b15aa3df186454515c9d75e18e
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Jul 1 19:37:05 2022 +0200

    [MPLUGIN-402] optionally render <extensions>true</extensions> in usage
    section
---
 .../apache/maven/plugin/plugin/PluginReport.java   | 23 ++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
index c6a6cc92..24e4ad4c 100644
--- a/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
+++ b/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
@@ -172,6 +172,15 @@ public class PluginReport
     @Parameter( defaultValue = "false", property = "maven.plugin.report.skip" )
     private boolean skipReport;
 
+    /**
+     * Set this to "true" to generate the usage section for "plugin-info.html" with
+     * {@code <extensions>true</extensions>}.
+     * 
+     * @since 3.7.0
+     */
+    @Parameter( defaultValue = "false", property = "maven.plugin.report.hasExtensionsToLoad" )
+    private boolean hasExtensionsToLoad;
+
     /**
      * List of Remote Repositories used by the resolver
      *
@@ -264,7 +273,8 @@ public class PluginReport
 
         // Write the overview
         PluginOverviewRenderer r =
-            new PluginOverviewRenderer( project, requirements, getSink(), pluginDescriptor, locale );
+            new PluginOverviewRenderer( project, requirements, getSink(), 
+                    pluginDescriptor, locale, hasExtensionsToLoad );
         r.render();
     }
 
@@ -437,6 +447,8 @@ public class PluginReport
 
         private final Locale locale;
 
+        private final boolean hasExtensionsToLoad;
+
         /**
          * @param project          not null
          * @param requirements     not null
@@ -445,7 +457,7 @@ public class PluginReport
          * @param locale           not null
          */
         PluginOverviewRenderer( MavenProject project, Requirements requirements, Sink sink,
-                                PluginDescriptor pluginDescriptor, Locale locale )
+                                PluginDescriptor pluginDescriptor, Locale locale, boolean hasExtensionsToLoad )
         {
             super( sink );
 
@@ -456,6 +468,8 @@ public class PluginReport
             this.pluginDescriptor = pluginDescriptor;
 
             this.locale = locale;
+
+            this.hasExtensionsToLoad = hasExtensionsToLoad;
         }
 
         /**
@@ -650,6 +664,11 @@ public class PluginReport
                 "</artifactId>" ).append( '\n' );
             sb.append( "          <version>" ).append( pluginDescriptor.getVersion() ).append( "</version>" ).append(
                 '\n' );
+            if ( hasExtensionsToLoad )
+            {
+                sb.append( "          <extensions>true</extensions>" ).append(
+                        '\n' );
+            }
             sb.append( "        </plugin>" ).append( '\n' );
             sb.append( "        ..." ).append( '\n' );
             sb.append( "      </plugins>" ).append( '\n' );