[MPLUGIN-168] Plugins with no mojos lead to exception and failure in PluginReport

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1164525 13f79535-47bb-0310-9956-ffa450edef68
master
Benson Margulies 2011-09-02 13:31:56 +00:00
parent f8e21c5bf7
commit 03e3a1d4c3
2 changed files with 13 additions and 7 deletions

View File

@ -172,6 +172,7 @@ public class PluginReport
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
@SuppressWarnings( "unchecked" )
protected void executeReport( Locale locale ) protected void executeReport( Locale locale )
throws MavenReportException throws MavenReportException
{ {
@ -216,7 +217,16 @@ public class PluginReport
PluginToolsRequest request = new DefaultPluginToolsRequest( project, pluginDescriptor ); PluginToolsRequest request = new DefaultPluginToolsRequest( project, pluginDescriptor );
request.setEncoding( encoding ); request.setEncoding( encoding );
try
{
mojoScanner.populatePluginDescriptor( request ); 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 // Generate the plugin's documentation
generatePluginDocumentation( pluginDescriptor, locale ); generatePluginDocumentation( pluginDescriptor, locale );
@ -226,11 +236,7 @@ public class PluginReport
locale ); locale );
r.render(); r.render();
} }
catch ( InvalidPluginDescriptorException e )
{
throw new MavenReportException( "Error extracting plugin descriptor: \'" + e.getLocalizedMessage() + "\'",
e );
}
catch ( ExtractionException e ) catch ( ExtractionException e )
{ {
throw new MavenReportException( "Error extracting plugin descriptor: \'" + e.getLocalizedMessage() + "\'", throw new MavenReportException( "Error extracting plugin descriptor: \'" + e.getLocalizedMessage() + "\'",

View File

@ -21,7 +21,7 @@ report.plugin.name=Plugin Documentation
report.plugin.description=This report provides goals and parameters documentation of a plugin. report.plugin.description=This report provides goals and parameters documentation of a plugin.
report.plugin.title=Plugin Documentation 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.intro=Goals available for this plugin:
report.plugin.goals.column.goal=Goal report.plugin.goals.column.goal=Goal
report.plugin.goals.column.isMavenReport=Report? report.plugin.goals.column.isMavenReport=Report?