You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by bi...@apache.org on 2011/09/02 15:31:56 UTC

svn commit: r1164525 - in /maven/plugin-tools/trunk/maven-plugin-plugin/src/main: java/org/apache/maven/plugin/plugin/PluginReport.java resources/plugin-report.properties

Author: bimargulies
Date: Fri Sep  2 13:31:56 2011
New Revision: 1164525

URL: http://svn.apache.org/viewvc?rev=1164525&view=rev
Log:
[MPLUGIN-168] Plugins with no mojos lead to exception and failure in PluginReport

Modified:
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
    maven/plugin-tools/trunk/maven-plugin-plugin/src/main/resources/plugin-report.properties

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java?rev=1164525&r1=1164524&r2=1164525&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/main/java/org/apache/maven/plugin/plugin/PluginReport.java Fri Sep  2 13:31:56 2011
@@ -172,6 +172,7 @@ public class PluginReport
     }
 
     /** {@inheritDoc} */
+    @SuppressWarnings( "unchecked" )
     protected void executeReport( Locale locale )
         throws MavenReportException
     {
@@ -216,7 +217,16 @@ public class PluginReport
             PluginToolsRequest request = new DefaultPluginToolsRequest( project, pluginDescriptor );
             request.setEncoding( encoding );
 
-            mojoScanner.populatePluginDescriptor( request );
+            try 
+            {
+                mojoScanner.populatePluginDescriptor( request );
+            }
+            catch ( InvalidPluginDescriptorException e )
+            {
+                // this is OK, it happens to lifecycle plugins. Allow generation to proceed.
+                getLog().debug( "Plugin without mojos.", e );
+
+            }
 
             // Generate the plugin's documentation
             generatePluginDocumentation( pluginDescriptor, locale );
@@ -226,11 +236,7 @@ public class PluginReport
                                                                    locale );
             r.render();
         }
-        catch ( InvalidPluginDescriptorException e )
-        {
-            throw new MavenReportException( "Error extracting plugin descriptor: \'" + e.getLocalizedMessage() + "\'",
-                                            e );
-        }
+        
         catch ( ExtractionException e )
         {
             throw new MavenReportException( "Error extracting plugin descriptor: \'" + e.getLocalizedMessage() + "\'",

Modified: maven/plugin-tools/trunk/maven-plugin-plugin/src/main/resources/plugin-report.properties
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-plugin/src/main/resources/plugin-report.properties?rev=1164525&r1=1164524&r2=1164525&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-plugin/src/main/resources/plugin-report.properties (original)
+++ maven/plugin-tools/trunk/maven-plugin-plugin/src/main/resources/plugin-report.properties Fri Sep  2 13:31:56 2011
@@ -21,7 +21,7 @@ report.plugin.name=Plugin Documentation
 report.plugin.description=This report provides goals and parameters documentation of a plugin.
 report.plugin.title=Plugin Documentation
 
-report.plugin.goals.nogoal=No goals available yet.
+report.plugin.goals.nogoal=No goals defined in this plugin.
 report.plugin.goals.intro=Goals available for this plugin:
 report.plugin.goals.column.goal=Goal
 report.plugin.goals.column.isMavenReport=Report?