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 0cac045824..e43caf5981 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 @@ -547,8 +547,10 @@ public class DefaultLifecycleExecutor { List tasks = (List) it.next(); - tasks.remove( mojoIdWithVersion ); - tasks.remove( mojoIdWithoutVersion ); + if ( tasks.remove( mojoIdWithVersion ) || tasks.remove( mojoIdWithoutVersion ) ) + { + getLogger().warn( "Removing: " + mojoDescriptor.getGoal() + " from forked lifecycle, to prevent recursive invocation of this mojo." ); + } } }