Class ProtoSession
java.lang.Object
org.apache.maven.internal.impl.AbstractSession
org.apache.maven.cling.invoker.mvn.ProtoSession
- All Implemented Interfaces:
Session
,InternalSession
-
Field Summary
Fields inherited from class org.apache.maven.internal.impl.AbstractSession
lookup, repositories, repositorySystem, session
-
Constructor Summary
ModifierConstructorDescriptionprotected
ProtoSession
(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.RepositorySystem repositorySystem, List<RemoteRepository> repositories, List<org.eclipse.aether.repository.RemoteRepository> resolverRepositories, Lookup lookup, org.apache.maven.cling.invoker.mvn.ProtoSession.Context context) -
Method Summary
Modifier and TypeMethodDescriptionstatic Session
create()
static Session
Create a new session.int
Returns the degree of concurrency for the build.getEffectiveProperties
(Project project) Each invocation computes a new map of effective properties.Returns the current maven version.getPluginContext
(Project project) Returns the plugin context for mojo being executed and the specifiedProject
, never returnsnull
as if context not present, creates it.Retrieves a list of projects associated with the session.Gets the root directory of the session, which is the root directory for the top directory project.Retrieves the settings for the current session.Returns the start time of the session.Returns immutable system properties to use for interpolation.Gets the directory of the topmost project being built, usually the current directory or the directory pointed at by the-f/--file
command line argument.Returns immutable user properties to use for interpolation.protected Session
newSession
(org.eclipse.aether.RepositorySystemSession session, List<RemoteRepository> repositories) Methods inherited from class org.apache.maven.internal.impl.AbstractSession
collectDependencies, collectDependencies, collectDependencies, createArtifact, createArtifact, createArtifactCoordinates, createArtifactCoordinates, createArtifactCoordinates, createArtifactCoordinates, createDependencyCoordinates, createDependencyCoordinates, createLocalRepository, createProducedArtifact, createProducedArtifact, createRemoteRepository, createRemoteRepository, deployArtifact, flattenDependencies, getArtifact, getArtifact, getArtifactPath, getData, getDependency, getListeners, getLocalRepository, getNode, getNode, getPathForLocalArtifact, getPathForRemoteArtifact, getRemoteRepositories, getRemoteRepository, getRepositorySystem, getService, getSession, installArtifacts, installArtifacts, isVersionSnapshot, parseVersion, parseVersionConstraint, parseVersionRange, registerListener, requireDependencyScope, requireLanguage, requirePackaging, requirePathScope, requireProjectScope, requireType, resolveArtifact, resolveArtifact, resolveArtifact, resolveArtifact, resolveArtifacts, resolveArtifacts, resolveArtifacts, resolveArtifacts, resolveDependencies, resolveDependencies, resolveDependencies, resolveDependencies, resolveDependencies, resolveVersion, resolveVersionRange, resolveVersionRange, setArtifactPath, toArtifact, toArtifact, toArtifacts, toDependencies, toDependency, toRepositories, toRepository, toRepository, unregisterListener, withLocalRepository, withRemoteRepositories
-
Constructor Details
-
ProtoSession
protected ProtoSession(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.RepositorySystem repositorySystem, List<RemoteRepository> repositories, List<org.eclipse.aether.repository.RemoteRepository> resolverRepositories, Lookup lookup, org.apache.maven.cling.invoker.mvn.ProtoSession.Context context)
-
-
Method Details
-
create
-
create
public static Session create(Map<String, String> userProperties, Map<String, String> systemProperties) Create a new session. -
newSession
protected Session newSession(org.eclipse.aether.RepositorySystemSession session, List<RemoteRepository> repositories) - Specified by:
newSession
in classAbstractSession
-
getSettings
Description copied from interface:Session
Retrieves the settings for the current session.- Returns:
- the settings instance
-
getUserProperties
Description copied from interface:Session
Returns immutable user properties to use for interpolation. The user properties have been configured directly by the user, e.g. via the-Dkey=value
parameter on the command line.- Returns:
- the user properties, never
null
-
getSystemProperties
Description copied from interface:Session
Returns immutable system properties to use for interpolation. The system properties are collected from the runtime environment such asSystem.getProperties()
and environment variables (prefixed withenv.
).- Returns:
- the system properties, never
null
-
getEffectiveProperties
Description copied from interface:Session
Each invocation computes a new map of effective properties. To be used in interpolation.Effective properties are computed from system, user and optionally project properties, layered with defined precedence onto each other to achieve proper precedence. Precedence is defined as:
- System properties (lowest precedence)
- Project properties (optional)
- User properties (highest precedence)
profile > project
, hence active profile property may override project property.The caller of this method should decide whether there is a project in scope (hence, a project instance needs to be passed) or not.
- Parameters:
project
-Project
ornull
.- Returns:
- the effective properties, never
null
-
getMavenVersion
Description copied from interface:Session
Returns the current maven version.- Returns:
- the maven version, never
null
-
getDegreeOfConcurrency
public int getDegreeOfConcurrency()Description copied from interface:Session
Returns the degree of concurrency for the build.- Returns:
- the degree of concurrency
-
getStartTime
Description copied from interface:Session
Returns the start time of the session.- Returns:
- the start time as an Instant object, never
null
-
getTopDirectory
Description copied from interface:Session
Gets the directory of the topmost project being built, usually the current directory or the directory pointed at by the-f/--file
command line argument.- Returns:
- the directory of the topmost project, never
null
- See Also:
-
getRootDirectory
Description copied from interface:Session
Gets the root directory of the session, which is the root directory for the top directory project.- Returns:
- the root directory, never
null
- See Also:
-
getProjects
Description copied from interface:Session
Retrieves a list of projects associated with the session.- Returns:
- a list of projects, never
null
-
getPluginContext
Description copied from interface:Session
Returns the plugin context for mojo being executed and the specifiedProject
, never returnsnull
as if context not present, creates it. Implementation note: while this method return type isMap
, the returned map instance implementsConcurrentMap
as well.
-