PR: MNG-914

set start time to the start of the request instead of the start of the executor to account for parent pom resolution

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@307300 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-10-08 14:48:38 +00:00
parent ac3e83d61c
commit 552ab6d2b3
5 changed files with 31 additions and 17 deletions

View File

@ -505,7 +505,7 @@ public class DefaultMaven
{ {
return new MavenSession( container, request.getSettings(), request.getLocalRepository(), return new MavenSession( container, request.getSettings(), request.getLocalRepository(),
request.getEventDispatcher(), rpm, request.getGoals(), request.getBaseDirectory(), request.getEventDispatcher(), rpm, request.getGoals(), request.getBaseDirectory(),
request.getExecutionProperties() ); request.getExecutionProperties(), request.getStartTime() );
} }
/** /**

View File

@ -22,6 +22,7 @@ import org.apache.maven.monitor.event.EventMonitor;
import org.apache.maven.profiles.ProfileManager; import org.apache.maven.profiles.ProfileManager;
import org.apache.maven.settings.Settings; import org.apache.maven.settings.Settings;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
@ -59,13 +60,11 @@ public class DefaultMavenExecutionRequest
private final Properties executionProperties; private final Properties executionProperties;
public DefaultMavenExecutionRequest( ArtifactRepository localRepository, private final Date startTime;
Settings settings,
EventDispatcher eventDispatcher, public DefaultMavenExecutionRequest( ArtifactRepository localRepository, Settings settings,
List goals, EventDispatcher eventDispatcher, List goals, String baseDirectory,
String baseDirectory, ProfileManager globalProfileManager, Properties executionProperties )
ProfileManager globalProfileManager,
Properties executionProperties )
{ {
this.localRepository = localRepository; this.localRepository = localRepository;
@ -80,6 +79,8 @@ public class DefaultMavenExecutionRequest
this.globalProfileManager = globalProfileManager; this.globalProfileManager = globalProfileManager;
this.executionProperties = executionProperties; this.executionProperties = executionProperties;
this.startTime = new Date();
} }
public Settings getSettings() public Settings getSettings()
@ -175,4 +176,9 @@ public class DefaultMavenExecutionRequest
{ {
return globalProfileManager; return globalProfileManager;
} }
public Date getStartTime()
{
return startTime;
}
} }

View File

@ -22,6 +22,7 @@ import org.apache.maven.monitor.event.EventMonitor;
import org.apache.maven.profiles.ProfileManager; import org.apache.maven.profiles.ProfileManager;
import org.apache.maven.settings.Settings; import org.apache.maven.settings.Settings;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
@ -66,4 +67,6 @@ public interface MavenExecutionRequest
ProfileManager getGlobalProfileManager(); ProfileManager getGlobalProfileManager();
Properties getExecutionProperties(); Properties getExecutionProperties();
Date getStartTime();
} }

View File

@ -24,6 +24,7 @@ import org.apache.maven.settings.Settings;
import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException; import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Properties; import java.util.Properties;
@ -53,14 +54,11 @@ public class MavenSession
private final Properties executionProperties; private final Properties executionProperties;
public MavenSession( PlexusContainer container, private final Date startTime;
Settings settings,
ArtifactRepository localRepository, public MavenSession( PlexusContainer container, Settings settings, ArtifactRepository localRepository,
EventDispatcher eventDispatcher, EventDispatcher eventDispatcher, ReactorManager reactorManager, List goals,
ReactorManager reactorManager, String executionRootDir, Properties executionProperties, Date startTime )
List goals,
String executionRootDir,
Properties executionProperties )
{ {
this.container = container; this.container = container;
@ -77,6 +75,8 @@ public class MavenSession
this.executionRootDir = executionRootDir; this.executionRootDir = executionRootDir;
this.executionProperties = executionProperties; this.executionProperties = executionProperties;
this.startTime = startTime;
} }
public Map getPluginContext( PluginDescriptor pluginDescriptor, MavenProject project ) public Map getPluginContext( PluginDescriptor pluginDescriptor, MavenProject project )
@ -161,4 +161,9 @@ public class MavenSession
{ {
return usingPOMsFromFilesystem; return usingPOMsFromFilesystem;
} }
public Date getStartTime()
{
return startTime;
}
} }

View File

@ -121,7 +121,7 @@ public class DefaultLifecycleExecutor
MavenExecutionResponse response = new MavenExecutionResponse(); MavenExecutionResponse response = new MavenExecutionResponse();
response.setStart( new Date() ); response.setStart( session.getStartTime() );
try try
{ {