[MNG-4536] Long build time - enforcer running too many times

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@904188 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2010-01-28 17:57:08 +00:00
parent 811c97ec30
commit c18b8872de
2 changed files with 4 additions and 12 deletions

View File

@ -217,7 +217,7 @@ public class DefaultLifecycleExecutor
logger.debug( "-----------------------------------------------------------------------" ); logger.debug( "-----------------------------------------------------------------------" );
logger.debug( "Goal: " + mojoExecId ); logger.debug( "Goal: " + mojoExecId );
logger.debug( "Style: " logger.debug( "Style: "
+ ( mojoExecution.getMojoDescriptor().isAggregating() ? "Aggregating" : "Regular" ) ); + ( mojoExecution.getMojoDescriptor().isAggregator() ? "Aggregating" : "Regular" ) );
logger.debug( "Configuration: " + mojoExecution.getConfiguration() ); logger.debug( "Configuration: " + mojoExecution.getConfiguration() );
} }
@ -490,7 +490,7 @@ public class DefaultLifecycleExecutor
this.scopesToCollect = new TreeSet<String>(); this.scopesToCollect = new TreeSet<String>();
this.scopesToResolve = new TreeSet<String>(); this.scopesToResolve = new TreeSet<String>();
collectDependencyRequirements( scopesToResolve, scopesToCollect, mojoExecution ); collectDependencyRequirements( scopesToResolve, scopesToCollect, mojoExecution );
this.aggregating = mojoExecution.getMojoDescriptor().isAggregating(); this.aggregating = mojoExecution.getMojoDescriptor().isAggregator();
} }
public DependencyContext clone() public DependencyContext clone()
@ -821,7 +821,7 @@ public class DefaultLifecycleExecutor
MojoDescriptor mojoDescriptor = getMojoDescriptor( task, session, session.getTopLevelProject() ); MojoDescriptor mojoDescriptor = getMojoDescriptor( task, session, session.getTopLevelProject() );
boolean aggregating = mojoDescriptor.isAggregating(); boolean aggregating = mojoDescriptor.isAggregator() || !mojoDescriptor.isProjectRequired();
if ( currentSegment == null || currentSegment.aggregating != aggregating ) if ( currentSegment == null || currentSegment.aggregating != aggregating )
{ {
@ -1135,7 +1135,7 @@ public class DefaultLifecycleExecutor
List<MavenProject> forkedProjects; List<MavenProject> forkedProjects;
if ( mojoDescriptor.isAggregating() ) if ( mojoDescriptor.isAggregator() )
{ {
forkedProjects = session.getProjects(); forkedProjects = session.getProjects();
} }

View File

@ -642,14 +642,6 @@ public class MojoDescriptor
return executeGoal; return executeGoal;
} }
/**
* @return {@code true} if this mojo is aggregating projects, {@code false} otherwise.
*/
public boolean isAggregating()
{
return isAggregator() || !isProjectRequired();
}
/** /**
* @return {@code true} if this mojo forks either a goal or the lifecycle, {@code false} otherwise. * @return {@code true} if this mojo forks either a goal or the lifecycle, {@code false} otherwise.
*/ */