From a866905cb40257864d39205dfdbd299b28cb496b Mon Sep 17 00:00:00 2001 From: John Dennis Casey Date: Wed, 30 May 2007 03:00:40 +0000 Subject: [PATCH] Fixing issue with different lifecycles getting in the way of one another, as when `mvn clean install` on a maven-plugin project catches the clean:clean binding from the clean lifecycle, and knocks out the plugin:descriptor binding from the beginning of the default lifecycle. Plugins can now be built using maven trunk once again. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@542734 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/maven/lifecycle/plan/BuildPlan.java | 3 ++- .../apache/maven/lifecycle/plan/DefaultBuildPlanner.java | 1 + maven-lifecycle/src/main/mdo/maven-lifecycle.mdo | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/plan/BuildPlan.java b/maven-core/src/main/java/org/apache/maven/lifecycle/plan/BuildPlan.java index 128fad10d6..f933e2eaa1 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/plan/BuildPlan.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/plan/BuildPlan.java @@ -155,7 +155,8 @@ public class BuildPlan List newRendered = new ArrayList( bindingsToAdd ); // if we've already executed part of the lifecycle, just continue with the new bindings. - if ( ( renderedLifecycleMojos != null ) && ( renderedLifecycleMojos.size() < bindingsToAdd.size() ) ) + if ( ( renderedLifecycleMojos != null ) && ( renderedLifecycleMojos.size() < bindingsToAdd.size() ) + && bindingsToAdd.containsAll( renderedLifecycleMojos ) ) { bindingsToAdd = bindingsToAdd.subList( renderedLifecycleMojos.size(), bindingsToAdd.size() ); } diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/plan/DefaultBuildPlanner.java b/maven-core/src/main/java/org/apache/maven/lifecycle/plan/DefaultBuildPlanner.java index d7e2b43093..d7bcb1e5f9 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/plan/DefaultBuildPlanner.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/plan/DefaultBuildPlanner.java @@ -71,6 +71,7 @@ public class DefaultBuildPlanner throws LifecycleSpecificationException, LifecycleLoaderException { List tasks = plan.getTasks(); + for ( Iterator it = tasks.iterator(); it.hasNext(); ) { String task = (String) it.next(); diff --git a/maven-lifecycle/src/main/mdo/maven-lifecycle.mdo b/maven-lifecycle/src/main/mdo/maven-lifecycle.mdo index 87ff3a7383..3013f7b15c 100644 --- a/maven-lifecycle/src/main/mdo/maven-lifecycle.mdo +++ b/maven-lifecycle/src/main/mdo/maven-lifecycle.mdo @@ -564,6 +564,7 @@ groupId true + true 1.0.0 Plugin's groupId. String @@ -571,6 +572,7 @@ artifactId true + true 1.0.0 Plugin's artifactId. String @@ -585,6 +587,7 @@ goal true + true 1.0.0 Mojo's goal name. String @@ -592,6 +595,7 @@ executionId 1.0.0 + true default A name for this mojo binding, for purposes of merging configurations via inheritance, etc. String @@ -615,6 +619,7 @@ boolean +