Author: jdcasey
Date: Thu Feb  7 17:03:03 2008
New Revision: 619720

URL: http://svn.apache.org/viewvc?rev=619720&view=rev
Log:
[MNG-2184] Skip aggregator-mojo execution when bound to the lifecycle (or bound 
as a report), and the current project is not the root project...in other words, 
detect aggregator mojos bound to the lifecycle in some way, and only execute 
them once using the root project.

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/viewvc/maven/components/trunk/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java?rev=619720&r1=619719&r2=619720&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
 Thu Feb  7 17:03:03 2008
@@ -521,6 +521,12 @@
 
             validateMojoExecution( mojoBinding, mojoDescriptor, project, 
allowAggregators );
 
+            if ( mojoDescriptor.isAggregator() && ( project != 
rm.getTopLevelProject() ) )
+            {
+                getLogger().debug( "Skipping mojo execution: " + 
MojoBindingUtils.toString( mojoBinding ) + "\nfor project: " + project.getId() 
+ "\n\nIt is an aggregator mojo, and the current project is not the root 
project for the reactor." );
+                return;
+            }
+
             MojoExecution mojoExecution = new MojoExecution( mojoDescriptor );
 
             mojoExecution.setConfiguration( (Xpp3Dom) 
mojoBinding.getConfiguration() );


Reply via email to