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 30ec7246b8..70f934a67f 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 @@ -8,7 +8,6 @@ import org.apache.maven.lifecycle.NoSuchPhaseException; import org.apache.maven.lifecycle.model.LifecycleBinding; import org.apache.maven.lifecycle.model.LifecycleBindings; import org.apache.maven.lifecycle.model.MojoBinding; -import org.apache.maven.lifecycle.model.Phase; import org.apache.maven.lifecycle.statemgmt.StateManagementUtils; import java.util.ArrayList; @@ -87,27 +86,11 @@ public class BuildPlan } public void markFullyResolved() + throws NoSuchPhaseException { - for ( Iterator bindingIterator = bindings.getBindingList().iterator(); bindingIterator.hasNext(); ) - { - LifecycleBinding binding = (LifecycleBinding) bindingIterator.next(); + List bindings = renderExecutionPlan( new Stack() ); - for ( Iterator phaseIterator = binding.getPhasesInOrder().iterator(); phaseIterator.hasNext(); ) - { - Phase phase = (Phase) phaseIterator.next(); - - for ( Iterator mojoBindingIterator = phase.getBindings().iterator(); mojoBindingIterator.hasNext(); ) - { - MojoBinding mojoBinding = (MojoBinding) mojoBindingIterator.next(); - - String key = MojoBindingUtils.createMojoBindingKey( mojoBinding, false ); - - fullyResolvedBindings.add( key ); - } - } - } - - for ( Iterator it = directInvocationBindings.values().iterator(); it.hasNext(); ) + for ( Iterator it = bindings.iterator(); it.hasNext(); ) { MojoBinding mojoBinding = (MojoBinding) it.next(); 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 c4035297c8..5d5e810d2c 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 @@ -208,6 +208,7 @@ public class DefaultBuildPlanner { if ( plan.isIncludingReports() ) { + logger.debug( "Report modifiers are already present in the build plan." ); return; } @@ -220,6 +221,7 @@ public class DefaultBuildPlanner if ( plan.isFullyResolved( mojoBinding ) ) { + logger.debug( "Skipping report-discovery for mojo: " + MojoBindingUtils.toString( mojoBinding ) + "; it is already fully resolved in the build plan." ); continue; } @@ -230,6 +232,7 @@ public class DefaultBuildPlanner if ( pluginDescriptor == null ) { + logger.debug( "Plugin descriptor not found for mojo: " + MojoBindingUtils.toString( mojoBinding ) + "; skipping for report-discovery." ); continue; } @@ -243,6 +246,7 @@ public class DefaultBuildPlanner if ( mojoDescriptor.isRequiresReports() ) { + logger.debug( "Mojo: " + MojoBindingUtils.toString( mojoBinding ) + " requires reports; running report-discovery." ); List reportBindings = lifecycleBindingManager.getReportBindings( project, session ); if ( reportBindings != null )