From 80f538bc52ce0272dd8ed029227ce7dd0b4bdf17 Mon Sep 17 00:00:00 2001 From: John Dennis Casey Date: Fri, 8 Feb 2008 01:06:16 +0000 Subject: [PATCH] Putting aggregator skip logic from previous commit ahead of warning messages, and adding some doco to the javadoc for the method to note the skip behavior. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@619721 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/maven/lifecycle/DefaultLifecycleExecutor.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java index c5255f69b2..258039eb41 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/DefaultLifecycleExecutor.java @@ -473,6 +473,10 @@ public class DefaultLifecycleExecutor * flag), and execute the mojo. If any of these steps fails, this method will * consult with the {@link ReactorManager} to determine whether the build * should be stopped. + *
+ * NOTE: If the binding is an aggregator mojo, and the specified project + * is not the root project of the reactor (using {@link ReactorManager#getTopLevelProject()}, + * then print a DEBUG message and skip that execution. */ private void executeGoalAndHandleFailures( final MojoBinding mojoBinding, final MavenSession session, @@ -519,14 +523,14 @@ public class DefaultLifecycleExecutor MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo( mojoBinding.getGoal() ); - 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; } + validateMojoExecution( mojoBinding, mojoDescriptor, project, allowAggregators ); + MojoExecution mojoExecution = new MojoExecution( mojoDescriptor ); mojoExecution.setConfiguration( (Xpp3Dom) mojoBinding.getConfiguration() );