From 7b1ca71aac7b34856c00dea190c744b541477bb6 Mon Sep 17 00:00:00 2001 From: Brett Leslie Porter Date: Mon, 28 Feb 2005 22:57:39 +0000 Subject: [PATCH] each task on the CLI is to be executed individually - don't preprocess all the goals. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163432 13f79535-47bb-0310-9956-ffa450edef68 --- .../lifecycle/DefaultLifecycleExecutor.java | 37 ++++++++----------- 1 file changed, 16 insertions(+), 21 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 dd1bf56729..ad74946bb0 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 @@ -81,12 +81,12 @@ public MavenExecutionResponse execute( List tasks, MavenSession session ) processPluginConfiguration( session.getProject(), session ); - processGoalChain( tasks, session ); - for ( Iterator i = tasks.iterator(); i.hasNext(); ) { String task = (String) i.next(); + processGoalChain( task, session ); + if ( phaseMap.containsKey( task ) ) { executePhase( task, session, response ); @@ -154,37 +154,32 @@ private void processPluginPhases( String pluginId, MavenSession mavenSession ) } } - private void processGoalChain( List tasks, MavenSession session ) + private void processGoalChain( String task, MavenSession session ) throws Exception { - for ( Iterator i = tasks.iterator(); i.hasNext(); ) + if ( phaseMap.containsKey( task ) ) { - String task = (String) i.next(); + // only execute up to the given phase + int index = phases.indexOf( phaseMap.get( task ) ); - if ( phaseMap.containsKey( task ) ) + for ( int j = 0; j <= index; j++ ) { - // only execute up to the given phase - int index = phases.indexOf( phaseMap.get( task ) ); + Phase p = (Phase) phases.get( j ); - for ( int j = 0; j <= index; j++ ) + if ( p.getGoals() != null ) { - Phase p = (Phase) phases.get( j ); - - if ( p.getGoals() != null ) + for ( Iterator k = p.getGoals().iterator(); k.hasNext(); ) { - for ( Iterator k = p.getGoals().iterator(); k.hasNext(); ) - { - String goal = (String) k.next(); + String goal = (String) k.next(); - verifyMojoPhase( goal, session ); - } + verifyMojoPhase( goal, session ); } } } - else - { - verifyMojoPhase( task, session ); - } + } + else + { + verifyMojoPhase( task, session ); } }