[MPLUGIN-114] PluginXdocGenerator NullPointerException

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@657562 13f79535-47bb-0310-9956-ffa450edef68
master
Benjamin Bentmann 2008-05-18 13:46:52 +00:00
parent f3a91b5cfd
commit bf2ece6f7a
3 changed files with 8 additions and 5 deletions

View File

@ -277,7 +277,7 @@ public class PluginReport
if ( !( pluginDescriptor.getMojos() != null && pluginDescriptor.getMojos().size() > 0 ) ) if ( !( pluginDescriptor.getMojos() != null && pluginDescriptor.getMojos().size() > 0 ) )
{ {
paragraph( getBundle( locale ).getString( "report.plugin.nogoal" ) ); paragraph( getBundle( locale ).getString( "report.plugin.goals.nogoal" ) );
endSection(); endSection();
return; return;
} }

View File

@ -92,6 +92,8 @@ public class PluginXdocGenerator
/** {@inheritDoc} */ /** {@inheritDoc} */
public void execute( File destinationDirectory, PluginDescriptor pluginDescriptor ) public void execute( File destinationDirectory, PluginDescriptor pluginDescriptor )
throws IOException throws IOException
{
if ( pluginDescriptor.getMojos() != null )
{ {
for ( Iterator it = pluginDescriptor.getMojos().iterator(); it.hasNext(); ) for ( Iterator it = pluginDescriptor.getMojos().iterator(); it.hasNext(); )
{ {
@ -99,6 +101,7 @@ public class PluginXdocGenerator
processMojoDescriptor( descriptor, destinationDirectory ); processMojoDescriptor( descriptor, destinationDirectory );
} }
} }
}
protected void processMojoDescriptor( MojoDescriptor mojoDescriptor, File destinationDirectory ) protected void processMojoDescriptor( MojoDescriptor mojoDescriptor, File destinationDirectory )
throws IOException throws IOException

View File

@ -192,7 +192,7 @@ public class DefaultMojoScannerTest
remainingGoals.remove( desc.getGoal() ) ); remainingGoals.remove( desc.getGoal() ) );
} }
assertTrue( "Extpected goals missing from PluginDescriptor: " + remainingGoals, remainingGoals.size() == 0 ); assertTrue( "Expected goals missing from PluginDescriptor: " + remainingGoals, remainingGoals.size() == 0 );
} }
} }