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
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultSession(MavenSession session, org.eclipse.aether.RepositorySystem repositorySystem, List<RemoteRepository> repositories, MavenRepositorySystem mavenRepositorySystem, org.codehaus.plexus.PlexusContainer container, RuntimeInformation runtimeInformation) -
Method Summary
Modifier and TypeMethodDescriptiongetData()intReturns the current maven versiongetPluginContext(Project project) Returns the plugin context for mojo being executed and the specifiedProject, never returnsnullas if context not present, creates it.org.eclipse.aether.RepositorySystemGets 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.RepositorySystemSessionGets 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/--filecommand line argument.Gets the user properties to use for interpolation.toArtifactRepository(RemoteRepository repository) org.eclipse.aether.graph.DependencytoDependency(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, createDependencyCoordinate, createDependencyCoordinate, createLocalRepository, createRemoteRepository, createRemoteRepository, deployArtifact, getArtifact, getArtifactPath, getDependency, getListeners, getNode, getNode, getPathForLocalArtifact, getPathForRemoteArtifact, getProject, getProjects, getRemoteRepository, installArtifacts, installArtifacts, isVersionSnapshot, parseVersion, parseVersionRange, registerListener, resolveArtifact, resolveArtifact, resolveArtifacts, resolveArtifacts, resolveArtifacts, 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 org.codehaus.plexus.PlexusContainer container, @Nonnull RuntimeInformation runtimeInformation)
-
-
Method Details
-
getMavenSession
-
getLocalRepository
-
getRemoteRepositories
-
getSettings
-
getUserProperties
Description copied from interface:SessionGets the 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.- Returns:
- the user properties, never
null
-
getSystemProperties
Description copied from interface:SessionGets 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:SessionReturns the current maven version- Returns:
- the maven version, never
null
-
getDegreeOfConcurrency
public int getDegreeOfConcurrency() -
getStartTime
-
getMultiModuleProjectDirectory
-
getExecutionRootDirectory
-
getRootDirectory
Description copied from interface:SessionGets the root directory of the session, which is the root directory for the top directory project. -
getTopDirectory
Description copied from interface:SessionGets the directory of the topmost project being built, usually the current directory or the directory pointed at by the-f/--filecommand line argument. -
getProjects
-
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. -
getData
-
withLocalRepository
Description copied from interface:SessionCreates a derived session using the given local repository.- Parameters:
localRepository- the new local repository- Returns:
- the derived session
-
withRemoteRepositories
Description copied from interface:SessionCreates 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:SessionRetrieves the service for the interface- Throws:
NoSuchElementException- if the service could not be found
-
getSession
-
getRepositorySystem
-
toArtifactRepository
- Specified by:
toArtifactRepositoryin classAbstractSession
-
toDependency
- Specified by:
toDependencyin classAbstractSession
-