Package org.apache.maven.internal.impl
Class DefaultSession
java.lang.Object
org.apache.maven.internal.impl.AbstractSession
org.apache.maven.internal.impl.DefaultSession
- All Implemented Interfaces:
ProtoSession,Session,InternalMavenSession,InternalSession
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.maven.api.ProtoSession
ProtoSession.Builder -
Field Summary
Fields inherited from class org.apache.maven.internal.impl.AbstractSession
lookup, repositories, repositorySystem, session -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSession(MavenSession session, org.eclipse.aether.RepositorySystem repositorySystem, List<RemoteRepository> remoteRepositories, MavenRepositorySystem mavenRepositorySystem, Lookup lookup, RuntimeInformation runtimeInformation) -
Method Summary
Modifier and TypeMethodDescriptionintReturns 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 returnsnullas if context not present, creates it.getProject(MavenProject project) May return null if the input project is null or is not part of the reactor.Retrieves a list of projects associated with the session.getProjects(List<MavenProject> projects) 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/--filecommand line argument.Returns immutable user properties to use for interpolation.protected SessionnewSession(MavenSession mavenSession, List<RemoteRepository> repositories) protected SessionnewSession(org.eclipse.aether.RepositorySystemSession repoSession, List<RemoteRepository> repositories) toArtifactRepositories(List<RemoteRepository> repositories) toArtifactRepository(RemoteRepository repository) 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, withRemoteRepositoriesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.internal.impl.InternalSession
getArtifact, getArtifact, getDependency, getNode, getNode, getRemoteRepository, getRepositorySystem, getSession, toArtifact, toArtifact, toArtifacts, toDependencies, toDependency, toRepositories, toRepository, toRepositoryMethods inherited from interface org.apache.maven.api.ProtoSession
toBuilderMethods inherited from interface org.apache.maven.api.Session
collectDependencies, collectDependencies, collectDependencies, createArtifact, createArtifact, createArtifactCoordinates, createArtifactCoordinates, createArtifactCoordinates, createArtifactCoordinates, createDependencyCoordinates, createDependencyCoordinates, createLocalRepository, createProducedArtifact, createProducedArtifact, createRemoteRepository, createRemoteRepository, deployArtifact, flattenDependencies, getArtifactPath, getData, getListeners, getLocalRepository, getPathForLocalArtifact, getPathForRemoteArtifact, getRemoteRepositories, getService, 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, unregisterListener, withLocalRepository, withRemoteRepositories
-
Constructor Details
-
DefaultSession
public DefaultSession(@Nonnull MavenSession session, @Nonnull org.eclipse.aether.RepositorySystem repositorySystem, @Nullable List<RemoteRepository> remoteRepositories, @Nonnull MavenRepositorySystem mavenRepositorySystem, @Nonnull Lookup lookup, @Nonnull RuntimeInformation runtimeInformation)
-
-
Method Details
-
getMavenSession
- Specified by:
getMavenSessionin interfaceInternalMavenSession
-
getProjects
- Specified by:
getProjectsin interfaceInternalMavenSession
-
getProject
Description copied from interface:InternalMavenSessionMay return null if the input project is null or is not part of the reactor.- Specified by:
getProjectin interfaceInternalMavenSession
-
toArtifactRepositories
- Specified by:
toArtifactRepositoriesin interfaceInternalMavenSession
-
getSettings
Description copied from interface:SessionRetrieves the settings for the current session.- Specified by:
getSettingsin interfaceSession- Returns:
- the settings instance
-
getUserProperties
Description copied from interface:ProtoSessionReturns immutable user properties to use for interpolation. The user properties have been configured directly by the user, e.g. via the-Dkey=valueparameter on the command line.- Specified by:
getUserPropertiesin interfaceProtoSession- Returns:
- the user properties, never
null
-
getSystemProperties
Description copied from interface:ProtoSessionReturns immutable system properties to use for interpolation. The system properties are collected from the runtime environment such asSystem.getProperties()and environment variables (prefixed withenv.).- Specified by:
getSystemPropertiesin interfaceProtoSession- Returns:
- the system properties, never
null
-
getEffectiveProperties
Description copied from interface:SessionEach 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.
- Specified by:
getEffectivePropertiesin interfaceSession- Parameters:
project-Projectornull.- Returns:
- the effective properties, never
null
-
getMavenVersion
Description copied from interface:SessionReturns the current maven version.- Specified by:
getMavenVersionin interfaceSession- Returns:
- the maven version, never
null
-
getDegreeOfConcurrency
public int getDegreeOfConcurrency()Description copied from interface:SessionReturns the degree of concurrency for the build.- Specified by:
getDegreeOfConcurrencyin interfaceSession- Returns:
- the degree of concurrency
-
getStartTime
Description copied from interface:ProtoSessionReturns the start time of the session.- Specified by:
getStartTimein interfaceProtoSession- Returns:
- the start time as an Instant object, never
null
-
getRootDirectory
Description copied from interface:ProtoSessionGets the root directory of the session, which is the root directory for the top directory project.- Specified by:
getRootDirectoryin interfaceProtoSession- Returns:
- the root directory, never
null - See Also:
-
getTopDirectory
Description copied from interface:ProtoSessionGets the directory of the topmost project being built, usually the current directory or the directory pointed at by the-f/--filecommand line argument.- Specified by:
getTopDirectoryin interfaceProtoSession- Returns:
- the directory of the topmost project, never
null - See Also:
-
getProjects
Description copied from interface:SessionRetrieves a list of projects associated with the session.- Specified by:
getProjectsin interfaceSession- Returns:
- a list of projects, never
null
-
getPluginContext
Description copied from interface:SessionReturns the plugin context for mojo being executed and the specifiedProject, never returnsnullas if context not present, creates it. Implementation note: while this method return type isMap, the returned map instance implementsConcurrentMapas well.- Specified by:
getPluginContextin interfaceSession
-
newSession
protected Session newSession(org.eclipse.aether.RepositorySystemSession repoSession, List<RemoteRepository> repositories) - Specified by:
newSessionin classAbstractSession
-
newSession
-
toArtifactRepository
- Specified by:
toArtifactRepositoryin interfaceInternalMavenSession
-