Author: evenisse
Date: Wed Jun 1 02:08:04 2005
New Revision: 179369
URL: http://svn.apache.org/viewcvs?rev=179369&view=rev
Log:
Check if plugin contains some mojo, and send an exception instead of
NullPointerException if it isn't the case.
Modified:
maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
Modified:
maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
URL:
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java?rev=179369&r1=179368&r2=179369&view=diff
==============================================================================
---
maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
(original)
+++
maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java
Wed Jun 1 02:08:04 2005
@@ -417,14 +417,24 @@
MojoDescriptor mojoDescriptor = null;
- // TODO: should be able to create a Map from this
- for ( Iterator i = pluginDescriptor.getMojos().iterator(); i.hasNext()
&& mojoDescriptor == null; )
+ if ( pluginDescriptor.getMojos() != null )
{
- MojoDescriptor desc = (MojoDescriptor) i.next();
- if ( desc.getGoal().equals( goal ) )
+ // TODO: should be able to create a Map from this
+ for ( Iterator i = pluginDescriptor.getMojos().iterator();
i.hasNext() && mojoDescriptor == null; )
{
- mojoDescriptor = desc;
+ MojoDescriptor desc = (MojoDescriptor) i.next();
+ if ( desc.getGoal().equals( goal ) )
+ {
+ mojoDescriptor = desc;
+ }
}
+ }
+ else
+ {
+ throw new LifecycleExecutionException( "The plugin " +
pluginDescriptor.getGroupId() + ":" +
+
pluginDescriptor.getArtifactId() + ":" +
+
pluginDescriptor.getVersion() +
+ " doesn't contain any mojo.
Check if it isn't corrupted." );
}
if ( mojoDescriptor == null )
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]