Author: trygvis
Date: Sat Jun 4 09:10:13 2005
New Revision: 180000
URL: http://svn.apache.org/viewcvs?rev=180000&view=rev
Log:
o Fixing a small bug that would cause a NPE if a plugin doesn't contain any
mojos.
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=180000&r1=179999&r2=180000&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
Sat Jun 4 09:10:13 2005
@@ -251,30 +251,33 @@
Map goalMap = plugin.getGoalsAsMap();
- for ( Iterator j = pluginDescriptor.getMojos().iterator();
j.hasNext(); )
+ if ( pluginDescriptor.getMojos() != null )
{
- MojoDescriptor mojoDescriptor = (MojoDescriptor) j.next();
-
- // TODO: remove later
- if ( mojoDescriptor.getGoal() == null )
+ for ( Iterator j = pluginDescriptor.getMojos().iterator();
j.hasNext(); )
{
- throw new LifecycleExecutionException(
- "The plugin " + artifactId + " was built with an older
version of Maven" );
- }
+ MojoDescriptor mojoDescriptor = (MojoDescriptor) j.next();
+
+ // TODO: remove later
+ if ( mojoDescriptor.getGoal() == null )
+ {
+ throw new LifecycleExecutionException(
+ "The plugin " + artifactId + " was built with an
older version of Maven" );
+ }
- Goal goal = (Goal) goalMap.get( mojoDescriptor.getGoal() );
+ Goal goal = (Goal) goalMap.get( mojoDescriptor.getGoal() );
- if( goalMap.isEmpty() )
- {
- configureMojoPhaseBinding( mojoDescriptor, phaseMap,
session.getSettings() );
- }
- else if ( goal != null )
- {
- // We have to check to see that the inheritance rules have
been applied before binding this mojo.
- if( goal.isInheritanceApplied() ||
mojoDescriptor.isInheritedByDefault() )
+ if( goalMap.isEmpty() )
{
configureMojoPhaseBinding( mojoDescriptor, phaseMap,
session.getSettings() );
}
+ else if ( goal != null )
+ {
+ // We have to check to see that the inheritance rules
have been applied before binding this mojo.
+ if( goal.isInheritanceApplied() ||
mojoDescriptor.isInheritedByDefault() )
+ {
+ configureMojoPhaseBinding( mojoDescriptor,
phaseMap, session.getSettings() );
+ }
+ }
}
}
}
@@ -450,4 +453,4 @@
return phases;
}
-}
\ No newline at end of file
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]