From c5e7758e3efe512dcdb5fc9bc45cc243fac68da2 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Wed, 10 Mar 2010 21:30:47 +0000 Subject: [PATCH] [MNG-4580] Plugin dependencies for module ignored when building from aggregator project using direct plugin invocation git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@921579 13f79535-47bb-0310-9956-ffa450edef68 --- .../lifecycle/DefaultLifecycleExecutor.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 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 0f5e6c3eb0..7a2ed45296 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 @@ -790,7 +790,9 @@ public class DefaultLifecycleExecutor { if ( task instanceof GoalTask ) { - MojoDescriptor mojoDescriptor = ( (GoalTask) task ).mojoDescriptor; + String pluginGoal = ( (GoalTask) task ).pluginGoal; + + MojoDescriptor mojoDescriptor = getMojoDescriptor( pluginGoal, session, project ); MojoExecution mojoExecution = new MojoExecution( mojoDescriptor, "default-cli", MojoExecution.Source.CLI ); @@ -868,7 +870,7 @@ public class DefaultLifecycleExecutor taskSegments.add( currentSegment ); } - currentSegment.tasks.add( new GoalTask( mojoDescriptor ) ); + currentSegment.tasks.add( new GoalTask( task ) ); } else { @@ -937,17 +939,17 @@ public class DefaultLifecycleExecutor private static final class GoalTask { - final MojoDescriptor mojoDescriptor; + final String pluginGoal; - GoalTask( MojoDescriptor mojoDescriptor ) + GoalTask( String pluginGoal ) { - this.mojoDescriptor = mojoDescriptor; + this.pluginGoal = pluginGoal; } @Override public String toString() { - return mojoDescriptor.getId(); + return pluginGoal; } } @@ -1092,6 +1094,7 @@ public class DefaultLifecycleExecutor for ( String goal : execution.getGoals() ) { MojoExecution mojoExecution = new MojoExecution( plugin, goal, execution.getId() ); + mojoExecution.setLifecyclePhase( execution.getPhase() ); addMojoExecution( phaseBindings, mojoExecution, execution.getPriority() ); } } @@ -1108,6 +1111,7 @@ public class DefaultLifecycleExecutor if ( phaseBindings != null ) { MojoExecution mojoExecution = new MojoExecution( mojoDescriptor, execution.getId() ); + mojoExecution.setLifecyclePhase( mojoDescriptor.getPhase() ); addMojoExecution( phaseBindings, mojoExecution, execution.getPriority() ); } }