mirror of https://github.com/apache/maven.git
o use a MavenExecutionRequest to hold all the information we need so that we can move toward referencing a single source of configuration information
for session and request level. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@512543 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8491a179f6
commit
9783df0a61
|
@ -37,49 +37,30 @@ public class MavenSession
|
||||||
{
|
{
|
||||||
private PlexusContainer container;
|
private PlexusContainer container;
|
||||||
|
|
||||||
private ArtifactRepository localRepository;
|
|
||||||
|
|
||||||
private List goals;
|
|
||||||
|
|
||||||
private EventDispatcher eventDispatcher;
|
private EventDispatcher eventDispatcher;
|
||||||
|
|
||||||
// TODO: make this the central one, get rid of build settings...
|
|
||||||
private final Settings settings;
|
|
||||||
|
|
||||||
private ReactorManager reactorManager;
|
private ReactorManager reactorManager;
|
||||||
|
|
||||||
private final String executionRootDir;
|
|
||||||
|
|
||||||
private boolean usingPOMsFromFilesystem = true;
|
private boolean usingPOMsFromFilesystem = true;
|
||||||
|
|
||||||
private final Properties executionProperties;
|
private MavenExecutionRequest request;
|
||||||
|
|
||||||
private final Date startTime;
|
public MavenSession( PlexusContainer container,
|
||||||
|
MavenExecutionRequest request,
|
||||||
public MavenSession( PlexusContainer container, Settings settings, ArtifactRepository localRepository,
|
EventDispatcher eventDispatcher,
|
||||||
EventDispatcher eventDispatcher, ReactorManager reactorManager, List goals,
|
ReactorManager reactorManager )
|
||||||
String executionRootDir, Properties executionProperties, Date startTime )
|
|
||||||
{
|
{
|
||||||
this.container = container;
|
this.container = container;
|
||||||
|
|
||||||
this.settings = settings;
|
this.request = request;
|
||||||
|
|
||||||
this.localRepository = localRepository;
|
|
||||||
|
|
||||||
this.eventDispatcher = eventDispatcher;
|
this.eventDispatcher = eventDispatcher;
|
||||||
|
|
||||||
this.reactorManager = reactorManager;
|
this.reactorManager = reactorManager;
|
||||||
|
|
||||||
this.goals = goals;
|
|
||||||
|
|
||||||
this.executionRootDir = executionRootDir;
|
|
||||||
|
|
||||||
this.executionProperties = executionProperties;
|
|
||||||
|
|
||||||
this.startTime = startTime;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map getPluginContext( PluginDescriptor pluginDescriptor, MavenProject project )
|
public Map getPluginContext( PluginDescriptor pluginDescriptor,
|
||||||
|
MavenProject project )
|
||||||
{
|
{
|
||||||
return reactorManager.getPluginContext( pluginDescriptor, project );
|
return reactorManager.getPluginContext( pluginDescriptor, project );
|
||||||
}
|
}
|
||||||
|
@ -91,17 +72,17 @@ public class MavenSession
|
||||||
|
|
||||||
public ArtifactRepository getLocalRepository()
|
public ArtifactRepository getLocalRepository()
|
||||||
{
|
{
|
||||||
return localRepository;
|
return request.getLocalRepository();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List getGoals()
|
public List getGoals()
|
||||||
{
|
{
|
||||||
return goals;
|
return request.getGoals();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Properties getExecutionProperties()
|
public Properties getExecutionProperties()
|
||||||
{
|
{
|
||||||
return executionProperties;
|
return request.getProperties();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
|
@ -114,7 +95,8 @@ public class MavenSession
|
||||||
return container.lookup( role );
|
return container.lookup( role );
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object lookup( String role, String roleHint )
|
public Object lookup( String role,
|
||||||
|
String roleHint )
|
||||||
throws ComponentLookupException
|
throws ComponentLookupException
|
||||||
{
|
{
|
||||||
return container.lookup( role, roleHint );
|
return container.lookup( role, roleHint );
|
||||||
|
@ -139,7 +121,7 @@ public class MavenSession
|
||||||
|
|
||||||
public Settings getSettings()
|
public Settings getSettings()
|
||||||
{
|
{
|
||||||
return settings;
|
return request.getSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List getSortedProjects()
|
public List getSortedProjects()
|
||||||
|
@ -149,7 +131,7 @@ public class MavenSession
|
||||||
|
|
||||||
public String getExecutionRootDirectory()
|
public String getExecutionRootDirectory()
|
||||||
{
|
{
|
||||||
return executionRootDir;
|
return request.getBaseDirectory();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsingPOMsFromFilesystem( boolean usingPOMsFromFilesystem )
|
public void setUsingPOMsFromFilesystem( boolean usingPOMsFromFilesystem )
|
||||||
|
@ -164,6 +146,11 @@ public class MavenSession
|
||||||
|
|
||||||
public Date getStartTime()
|
public Date getStartTime()
|
||||||
{
|
{
|
||||||
return startTime;
|
return request.getStartTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MavenExecutionRequest getRequest()
|
||||||
|
{
|
||||||
|
return request;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue