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:
Session
,InternalSession
-
Constructor Summary
ConstructorDescriptionDefaultSession
(MavenSession session, org.eclipse.aether.RepositorySystem repositorySystem, List<RemoteRepository> repositories, MavenRepositorySystem mavenRepositorySystem, Lookup lookup, RuntimeInformation runtimeInformation) -
Method Summary
Modifier and TypeMethodDescriptiongetData()
int
Returns the current maven versiongetPluginContext
(Project project) Returns the plugin context for mojo being executed and the specifiedProject
, never returnsnull
as if context not present, creates it.org.eclipse.aether.RepositorySystem
Gets the root directory of the session, which is the root directory for the top directory project.<T extends Service>
TgetService
(Class<T> clazz) Retrieves the service for the interfaceorg.eclipse.aether.RepositorySystemSession
Gets the 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.Gets the user properties to use for interpolation.toArtifactRepository
(RemoteRepository repository) org.eclipse.aether.graph.Dependency
toDependency
(DependencyCoordinate dependency) withLocalRepository
(LocalRepository localRepository) Creates a derived session using the given local repository.withRemoteRepositories
(List<RemoteRepository> repositories) Creates a derived session using the given remote repositories.Methods inherited from class org.apache.maven.internal.impl.AbstractSession
collectDependencies, collectDependencies, collectDependencies, createArtifact, createArtifact, createArtifactCoordinate, createArtifactCoordinate, createArtifactCoordinate, createArtifactCoordinate, createDependencyCoordinate, createDependencyCoordinate, createLocalRepository, createRemoteRepository, createRemoteRepository, deployArtifact, flattenDependencies, getArtifact, getArtifactPath, getDependency, getListeners, getNode, getNode, getPathForLocalArtifact, getPathForRemoteArtifact, getProject, getProjects, getRemoteRepository, installArtifacts, installArtifacts, isVersionSnapshot, parseVersion, parseVersionConstraint, parseVersionRange, registerListener, resolveArtifact, resolveArtifact, resolveArtifacts, resolveArtifacts, resolveArtifacts, resolveDependencies, resolveDependencies, resolveDependencies, resolveVersion, resolveVersionRange, setArtifactPath, toArtifact, toArtifact, toArtifactRepositories, toArtifacts, toDependencies, toRepositories, toRepository, toRepository, unregisterListener
-
Constructor Details
-
DefaultSession
public DefaultSession(@Nonnull MavenSession session, @Nonnull org.eclipse.aether.RepositorySystem repositorySystem, @Nullable List<RemoteRepository> repositories, @Nonnull MavenRepositorySystem mavenRepositorySystem, @Nonnull Lookup lookup, @Nonnull RuntimeInformation runtimeInformation)
-
-
Method Details
-
getMavenSession
-
getLocalRepository
-
getRemoteRepositories
-
getSettings
-
getUserProperties
Description copied from interface:Session
Gets the 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
Gets the system properties to use for interpolation. The system properties are collected from the runtime environment such asSystem.getProperties()
and environment variables.- Returns:
- the system properties, never
null
-
getMavenVersion
Description copied from interface:Session
Returns the current maven version- Returns:
- the maven version, never
null
-
getDegreeOfConcurrency
public int getDegreeOfConcurrency() -
getStartTime
-
getRootDirectory
Description copied from interface:Session
Gets the root directory of the session, which is the root directory for the top directory project.- See Also:
-
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. -
getProjects
-
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. -
getData
-
withLocalRepository
Description copied from interface:Session
Creates a derived session using the given local repository.- Parameters:
localRepository
- the new local repository- Returns:
- the derived session
-
withRemoteRepositories
Description copied from interface:Session
Creates a derived session using the given remote repositories.- Parameters:
repositories
- the new list of remote repositories- Returns:
- the derived session
-
getService
Description copied from interface:Session
Retrieves the service for the interface- Throws:
NoSuchElementException
- if the service could not be found
-
getSession
-
getRepositorySystem
-
toArtifactRepository
- Specified by:
toArtifactRepository
in interfaceInternalSession
- Specified by:
toArtifactRepository
in classAbstractSession
-
toDependency
- Specified by:
toDependency
in interfaceInternalSession
- Specified by:
toDependency
in classAbstractSession
-