Package org.apache.maven.execution
Class MavenSession
java.lang.Object
org.apache.maven.execution.MavenSession
- All Implemented Interfaces:
Cloneable
A Maven execution session.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<MavenProject> The full set of projects before any potential constraining by --projects.private final org.codehaus.plexus.PlexusContainerprivate ThreadLocal<MavenProject> private final Propertiesprivate booleanprivate final ConcurrentMap<String, ConcurrentMap<String, ConcurrentMap<String, Object>>> Plugin context keyed by project (MavenProject.getId()) and by plugin lookup key (PluginDescriptor.getPluginLookupKey()).private ProjectDependencyGraphprivate Map<String, MavenProject> private List<MavenProject> These projects have already been topologically sorted in theMavencomponent before being passed into the session.private final org.eclipse.aether.RepositorySystemSessionprivate final MavenExecutionRequestprivate final MavenExecutionResultprivate Sessionprivate final Settingsprivate MavenProject -
Constructor Summary
ConstructorsConstructorDescriptionMavenSession(org.codehaus.plexus.PlexusContainer container, MavenExecutionRequest request, MavenExecutionResult result, List<MavenProject> projects) Deprecated.MavenSession(org.codehaus.plexus.PlexusContainer container, MavenExecutionRequest request, MavenExecutionResult result, MavenProject project) Deprecated.MavenSession(org.codehaus.plexus.PlexusContainer container, Settings settings, ArtifactRepository localRepository, EventDispatcher eventDispatcher, ReactorManager unused, List<String> goals, String executionRootDir, Properties executionProperties, Date startTime) Deprecated.MavenSession(org.codehaus.plexus.PlexusContainer container, Settings settings, ArtifactRepository localRepository, EventDispatcher eventDispatcher, ReactorManager unused, List<String> goals, String executionRootDir, Properties executionProperties, Properties userProperties, Date startTime) Deprecated.MavenSession(org.codehaus.plexus.PlexusContainer container, org.eclipse.aether.RepositorySystemSession repositorySession, MavenExecutionRequest request, MavenExecutionResult result) Deprecated.MavenSession(org.eclipse.aether.RepositorySystemSession repositorySystemSession, MavenExecutionRequest request, MavenExecutionResult result) -
Method Summary
Modifier and TypeMethodDescriptionprivate static SettingsadaptSettings(MavenExecutionRequest request) Adapt aMavenExecutionRequestto aSettingsobject for use in the Maven core.clone()This is a provisional method and may be removedorg.codehaus.plexus.PlexusContainerDeprecated.Deprecated.Deprecated.Deprecated.usegetTopDirectory()()}getGoals()getPluginContext(PluginDescriptor plugin, MavenProject project) Returns the plugin context for given key (PluginDescriptor.getPluginLookupKey()andMavenProject, never returnsnullas if context not present, creates it.Deprecated.Deprecated.org.eclipse.aether.RepositorySystemSessionDeprecated.Deprecated.Gets the system properties to use for interpolation and profile activation.Gets the user properties to use for interpolation and profile activation.booleanbooleanbooleanDeprecated.Deprecated.Deprecated.lookupList(String role) Deprecated.Deprecated.voidsetAllProjects(List<MavenProject> allProjects) This is a provisional method and may be removedvoidsetCurrentProject(MavenProject currentProject) voidsetParallel(boolean parallel) voidsetProjectDependencyGraph(ProjectDependencyGraph projectDependencyGraph) voidsetProjectMap(Map<String, MavenProject> projectMap) voidsetProjects(List<MavenProject> projects) voidsetSession(Session session)
-
Field Details
-
request
-
result
-
repositorySystemSession
private final org.eclipse.aether.RepositorySystemSession repositorySystemSession -
executionProperties
-
currentProject
-
projects
These projects have already been topologically sorted in theMavencomponent before being passed into the session. This is also the potentially constrained set of projects by using --projects on the command line. -
allProjects
The full set of projects before any potential constraining by --projects. Useful in the case where you want to build a smaller set of projects but perform other operations in the context of your reactor. -
topLevelProject
-
projectDependencyGraph
-
parallel
private boolean parallel -
pluginContextsByProjectAndPluginKey
private final ConcurrentMap<String,ConcurrentMap<String, pluginContextsByProjectAndPluginKeyConcurrentMap<String, Object>>> Plugin context keyed by project (MavenProject.getId()) and by plugin lookup key (PluginDescriptor.getPluginLookupKey()). Plugin contexts itself are mappings ofStringkeys toObjectvalues. -
projectMap
-
container
private final org.codehaus.plexus.PlexusContainer container -
settings
-
session
-
-
Constructor Details
-
MavenSession
public MavenSession(org.eclipse.aether.RepositorySystemSession repositorySystemSession, MavenExecutionRequest request, MavenExecutionResult result) -
MavenSession
@Deprecated public MavenSession(org.codehaus.plexus.PlexusContainer container, org.eclipse.aether.RepositorySystemSession repositorySession, MavenExecutionRequest request, MavenExecutionResult result) Deprecated. -
MavenSession
@Deprecated public MavenSession(org.codehaus.plexus.PlexusContainer container, MavenExecutionRequest request, MavenExecutionResult result, MavenProject project) Deprecated. -
MavenSession
@Deprecated public MavenSession(org.codehaus.plexus.PlexusContainer container, Settings settings, ArtifactRepository localRepository, EventDispatcher eventDispatcher, ReactorManager unused, List<String> goals, String executionRootDir, Properties executionProperties, Date startTime) Deprecated. -
MavenSession
@Deprecated public MavenSession(org.codehaus.plexus.PlexusContainer container, Settings settings, ArtifactRepository localRepository, EventDispatcher eventDispatcher, ReactorManager unused, List<String> goals, String executionRootDir, Properties executionProperties, Properties userProperties, Date startTime) Deprecated. -
MavenSession
@Deprecated public MavenSession(org.codehaus.plexus.PlexusContainer container, MavenExecutionRequest request, MavenExecutionResult result, List<MavenProject> projects) Deprecated.
-
-
Method Details
-
setProjects
-
getLocalRepository
-
getGoals
-
getUserProperties
Gets the user properties to use for interpolation and profile activation. The user properties have been configured directly by the user on his discretion, e.g. via the-Dkey=valueparameter on the command line.- Returns:
- The user properties, never
null.
-
getSystemProperties
Gets the system properties to use for interpolation and profile activation. The system properties are collected from the runtime environment likeSystem.getProperties()and environment variables.- Returns:
- The system properties, never
null.
-
getSettings
-
getProjects
-
getExecutionRootDirectory
Deprecated.usegetTopDirectory()()} -
getTopDirectory
- Since:
- 4.0.0
- See Also:
-
getRootDirectory
- Since:
- 4.0.0
- See Also:
-
getRequest
-
setCurrentProject
-
getCurrentProject
-
getProjectBuildingRequest
-
getPluginGroups
-
isOffline
public boolean isOffline() -
getTopLevelProject
-
getResult
-
getPluginContext
Returns the plugin context for given key (PluginDescriptor.getPluginLookupKey()andMavenProject, never returnsnullas if context not present, creates it. Implementation note: while this method return type isMap, the returned map instance implementsConcurrentMapas well. -
getProjectDependencyGraph
-
setProjectDependencyGraph
-
getReactorFailureBehavior
-
clone
-
getStartTime
Deprecated. -
getStartInstant
-
isParallel
public boolean isParallel() -
setParallel
public void setParallel(boolean parallel) -
getRepositorySession
public org.eclipse.aether.RepositorySystemSession getRepositorySession() -
setProjectMap
-
getAllProjects
This is a provisional method and may be removed -
setAllProjects
This is a provisional method and may be removed -
getProjectMap
Deprecated. -
adaptSettings
Adapt aMavenExecutionRequestto aSettingsobject for use in the Maven core. We want to make sure that what is ask for in the execution request overrides what is in the settings. The CLI feeds into an execution request so if a particular value is present in the execution request then we will take that over the value coming from the user settings. -
getSortedProjects
Deprecated. -
getRepositoryCache
Deprecated. -
getEventDispatcher
Deprecated. -
isUsingPOMsFromFilesystem
Deprecated. -
getExecutionProperties
Deprecated.Use eithergetUserProperties()orgetSystemProperties(). -
getContainer
Deprecated. -
lookup
@Deprecated public Object lookup(String role) throws org.codehaus.plexus.component.repository.exception.ComponentLookupException Deprecated.- Throws:
org.codehaus.plexus.component.repository.exception.ComponentLookupException
-
lookup
@Deprecated public Object lookup(String role, String roleHint) throws org.codehaus.plexus.component.repository.exception.ComponentLookupException Deprecated.- Throws:
org.codehaus.plexus.component.repository.exception.ComponentLookupException
-
lookupList
@Deprecated public List<Object> lookupList(String role) throws org.codehaus.plexus.component.repository.exception.ComponentLookupException Deprecated.- Throws:
org.codehaus.plexus.component.repository.exception.ComponentLookupException
-
lookupMap
@Deprecated public Map<String,Object> lookupMap(String role) throws org.codehaus.plexus.component.repository.exception.ComponentLookupException Deprecated.- Throws:
org.codehaus.plexus.component.repository.exception.ComponentLookupException
-
getSession
-
setSession
-
getUserProperties()orgetSystemProperties().