Class AbstractSession
java.lang.Object
org.apache.maven.impl.AbstractSession
- All Implemented Interfaces:
- ProtoSession,- Session,- InternalSession
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.apache.maven.api.ProtoSessionProtoSession.Builder
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected final Lookupprotected final List<RemoteRepository> protected final org.eclipse.aether.RepositorySystemprotected final org.eclipse.aether.RepositorySystemSession
- 
Constructor SummaryConstructorsConstructorDescriptionAbstractSession(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.RepositorySystem repositorySystem, List<RemoteRepository> repositories, List<org.eclipse.aether.repository.RemoteRepository> resolverRepositories, Lookup lookup) 
- 
Method SummaryModifier and TypeMethodDescriptioncollectDependencies(Artifact artifact, PathScope scope) Shortcut forgetService(DependencyResolver.class).collect(...)collectDependencies(DependencyCoordinates dependency, PathScope scope) Shortcut forgetService(DependencyResolver.class).collect(...)collectDependencies(Project project, PathScope scope) Shortcut forgetService(DependencyResolver.class).collect(...)createArtifact(String groupId, String artifactId, String version, String extension) Shortcut forgetService(ArtifactFactory.class).create(...)createArtifact(String groupId, String artifactId, String version, String classifier, String extension, String type) Shortcut forgetService(ArtifactFactory.class).create(...)createArtifactCoordinates(String coordString) Shortcut forgetService(ArtifactCoordinatesFactory.class).create(...)createArtifactCoordinates(String groupId, String artifactId, String version, String extension) Shortcut forgetService(ArtifactCoordinatesFactory.class).create(...)createArtifactCoordinates(String groupId, String artifactId, String version, String classifier, String extension, String type) Shortcut forgetService(ArtifactCoordinatesFactory.class).create(...)createArtifactCoordinates(Artifact artifact) Shortcut forgetService(ArtifactCoordinatesFactory.class).create(...)createDependencyCoordinates(ArtifactCoordinates coordinates) Shortcut forgetService(DependencyFactory.class).create(...)createDependencyCoordinates(Dependency dependency) Shortcut forgetService(DependencyFactory.class).create(...)createLocalRepository(Path path) Shortcut forgetService(RepositoryFactory.class).createLocal(...)createProducedArtifact(String groupId, String artifactId, String version, String extension) Shortcut forgetService(ArtifactFactory.class).createProduced(...)createProducedArtifact(String groupId, String artifactId, String version, String classifier, String extension, String type) Shortcut forgetService(ArtifactFactory.class).createProduced(...)createRemoteRepository(String id, String url) Shortcut forgetService(RepositoryFactory.class).createRemote(...)createRemoteRepository(Repository repository) Shortcut forgetService(RepositoryFactory.class).createRemote(...)voiddeployArtifact(RemoteRepository repository, ProducedArtifact... artifacts) Shortcut forgetService(ArtifactDeployer.class).deploy(...)flattenDependencies(Node node, PathScope scope) <T extends Artifact>
 TgetArtifact(Class<T> clazz, org.eclipse.aether.artifact.Artifact artifact) getArtifact(org.eclipse.aether.artifact.Artifact artifact) getArtifactPath(Artifact artifact) Shortcut forgetService(ArtifactManager.class).getPath(...)Gets the current request trace for the session from thread-local storage.getData()getDependency(org.eclipse.aether.graph.Dependency dependency) getLocalRepository(org.eclipse.aether.repository.LocalRepository repository) getNode(org.eclipse.aether.graph.DependencyNode node) getNode(org.eclipse.aether.graph.DependencyNode node, boolean verbose) getPathForLocalArtifact(Artifact artifact) getPathForRemoteArtifact(RemoteRepository remote, Artifact artifact) getRemoteRepository(org.eclipse.aether.repository.RemoteRepository repository) getRepository(org.eclipse.aether.repository.ArtifactRepository repository) org.eclipse.aether.RepositorySystem<T extends Service>
 TgetService(Class<T> clazz) org.eclipse.aether.RepositorySystemSessiongetWorkspaceRepository(org.eclipse.aether.repository.WorkspaceRepository repository) voidinstallArtifacts(Collection<ProducedArtifact> artifacts) Shortcut forgetService(ArtifactInstaller.class).install(...)voidinstallArtifacts(ProducedArtifact... artifacts) Shortcut forgetService(ArtifactInstaller.class).install(...)booleanisVersionSnapshot(String version) Shortcut forgetService(VersionParser.class).isSnapshot(...)protected abstract SessionnewSession(org.eclipse.aether.RepositorySystemSession session, List<RemoteRepository> repositories) parseVersion(String version) parseVersionConstraint(String versionConstraint) parseVersionRange(String versionRange) voidregisterListener(Listener listener) Executes and optionally caches a request using the provided supplier function.requireType(String id) resolveArtifact(Artifact artifact) Shortcut forgetService(ArtifactResolver.class).resolve(...)resolveArtifact(ArtifactCoordinates coordinates) Shortcut forgetService(ArtifactResolver.class).resolve(...)resolveArtifact(ArtifactCoordinates coordinates, List<RemoteRepository> repositories) Shortcut forgetService(ArtifactResolver.class).resolve(...)resolveArtifact(Artifact artifact, List<RemoteRepository> repositories) Shortcut forgetService(ArtifactResolver.class).resolve(...)resolveArtifacts(Collection<? extends ArtifactCoordinates> coordinates) Shortcut forgetService(ArtifactResolver.class).resolve(...)resolveArtifacts(Collection<? extends ArtifactCoordinates> coordinates, List<RemoteRepository> repositories) Shortcut forgetService(ArtifactResolver.class).resolve(...)resolveArtifacts(Artifact... artifacts) resolveArtifacts(ArtifactCoordinates... coordinates) Shortcut forgetService(ArtifactResolver.class).resolve(...)resolveDependencies(List<DependencyCoordinates> dependencies) resolveDependencies(DependencyCoordinates dependency) resolveDependencies(DependencyCoordinates dependency, PathScope scope, Collection<PathType> desiredTypes) resolveDependencies(Project project, PathScope scope) resolveDependencies(Project project, PathScope scope, Collection<PathType> desiredTypes) resolveHighestVersion(ArtifactCoordinates artifact, List<RemoteRepository> repositories) resolveVersion(ArtifactCoordinates artifact) resolveVersionRange(ArtifactCoordinates artifact) resolveVersionRange(ArtifactCoordinates artifact, List<RemoteRepository> repositories) voidsetArtifactPath(ProducedArtifact artifact, Path path) Shortcut forgetService(ArtifactManager.class).setPath(...)voidsetCurrentTrace(RequestTrace trace) Sets the current request trace for the session.org.eclipse.aether.artifact.ArtifacttoArtifact(Artifact artifact) org.eclipse.aether.artifact.ArtifacttoArtifact(ArtifactCoordinates coords) List<org.eclipse.aether.artifact.Artifact> toArtifacts(Collection<? extends Artifact> artifacts) List<org.eclipse.aether.graph.Dependency> toDependencies(Collection<DependencyCoordinates> dependencies, boolean managed) org.eclipse.aether.graph.DependencytoDependency(DependencyCoordinates dependency, boolean managed) List<org.eclipse.aether.repository.RemoteRepository> toRepositories(List<RemoteRepository> repositories) org.eclipse.aether.repository.LocalRepositorytoRepository(LocalRepository repository) org.eclipse.aether.repository.RemoteRepositorytoRepository(RemoteRepository repository) voidunregisterListener(Listener listener) withLocalRepository(LocalRepository localRepository) withRemoteRepositories(List<RemoteRepository> repositories) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.api.ProtoSessiongetRootDirectory, getStartTime, getSystemProperties, getTopDirectory, getUserProperties, toBuilderMethods inherited from interface org.apache.maven.api.SessiongetDegreeOfConcurrency, getEffectiveProperties, getMavenVersion, getPluginContext, getProjects, getSettings, getToolchains
- 
Field Details- 
sessionprotected final org.eclipse.aether.RepositorySystemSession session
- 
repositorySystemprotected final org.eclipse.aether.RepositorySystem repositorySystem
- 
repositories
- 
lookup
 
- 
- 
Constructor Details- 
AbstractSessionpublic AbstractSession(org.eclipse.aether.RepositorySystemSession session, org.eclipse.aether.RepositorySystem repositorySystem, List<RemoteRepository> repositories, List<org.eclipse.aether.repository.RemoteRepository> resolverRepositories, Lookup lookup) 
 
- 
- 
Method Details- 
requestpublic <REQ extends Request<?>, REP extends Result<REQ>> REP request(REQ req, Function<REQ, REP> supplier) Description copied from interface:InternalSessionExecutes and optionally caches a request using the provided supplier function. If caching is enabled for this session, the result will be cached and subsequent identical requests will return the cached value without re-executing the supplier.- Specified by:
- requestin interface- InternalSession
- Type Parameters:
- REQ- The request type
- REP- The response type
- Parameters:
- req- The request object used as the cache key
- supplier- The function to execute and cache the result
- Returns:
- The result from the supplier (either fresh or cached)
 
- 
requests
- 
getRemoteRepositorypublic RemoteRepository getRemoteRepository(org.eclipse.aether.repository.RemoteRepository repository) - Specified by:
- getRemoteRepositoryin interface- InternalSession
 
- 
getLocalRepository- Specified by:
- getLocalRepositoryin interface- InternalSession
 
- 
getWorkspaceRepositorypublic WorkspaceRepository getWorkspaceRepository(org.eclipse.aether.repository.WorkspaceRepository repository) - Specified by:
- getWorkspaceRepositoryin interface- InternalSession
 
- 
getRepository- Specified by:
- getRepositoryin interface- InternalSession
 
- 
getNode- Specified by:
- getNodein interface- InternalSession
 
- 
getNode- Specified by:
- getNodein interface- InternalSession
 
- 
getArtifact- Specified by:
- getArtifactin interface- InternalSession
 
- 
getArtifactpublic <T extends Artifact> T getArtifact(Class<T> clazz, org.eclipse.aether.artifact.Artifact artifact) - Specified by:
- getArtifactin interface- InternalSession
 
- 
getDependency- Specified by:
- getDependencyin interface- InternalSession
 
- 
toRepositoriespublic List<org.eclipse.aether.repository.RemoteRepository> toRepositories(List<RemoteRepository> repositories) - Specified by:
- toRepositoriesin interface- InternalSession
 
- 
toRepository- Specified by:
- toRepositoryin interface- InternalSession
 
- 
toRepository- Specified by:
- toRepositoryin interface- InternalSession
 
- 
toDependenciespublic List<org.eclipse.aether.graph.Dependency> toDependencies(Collection<DependencyCoordinates> dependencies, boolean managed) - Specified by:
- toDependenciesin interface- InternalSession
 
- 
getRemoteRepositories- Specified by:
- getRemoteRepositoriesin interface- Session
 
- 
getData
- 
getLocalRepository- Specified by:
- getLocalRepositoryin interface- Session
 
- 
withLocalRepository- Specified by:
- withLocalRepositoryin interface- Session
 
- 
withRemoteRepositories- Specified by:
- withRemoteRepositoriesin interface- Session
 
- 
newSessionprotected abstract Session newSession(org.eclipse.aether.RepositorySystemSession session, List<RemoteRepository> repositories) 
- 
getService- Specified by:
- getServicein interface- Session
- Throws:
- NoSuchElementException
 
- 
getSession- Specified by:
- getSessionin interface- InternalSession
 
- 
getRepositorySystem- Specified by:
- getRepositorySystemin interface- InternalSession
 
- 
toDependencypublic org.eclipse.aether.graph.Dependency toDependency(DependencyCoordinates dependency, boolean managed) - Specified by:
- toDependencyin interface- InternalSession
 
- 
toArtifactspublic List<org.eclipse.aether.artifact.Artifact> toArtifacts(Collection<? extends Artifact> artifacts) - Specified by:
- toArtifactsin interface- InternalSession
 
- 
toArtifact- Specified by:
- toArtifactin interface- InternalSession
 
- 
toArtifact- Specified by:
- toArtifactin interface- InternalSession
 
- 
registerListener- Specified by:
- registerListenerin interface- Session
 
- 
unregisterListener- Specified by:
- unregisterListenerin interface- Session
 
- 
getListeners- Specified by:
- getListenersin interface- Session
 
- 
createLocalRepositoryShortcut forgetService(RepositoryFactory.class).createLocal(...)- Specified by:
- createLocalRepositoryin interface- Session
- See Also:
 
- 
createRemoteRepositoryShortcut forgetService(RepositoryFactory.class).createRemote(...)- Specified by:
- createRemoteRepositoryin interface- Session
- See Also:
 
- 
createRemoteRepositoryShortcut forgetService(RepositoryFactory.class).createRemote(...)- Specified by:
- createRemoteRepositoryin interface- Session
- See Also:
 
- 
createArtifactCoordinatespublic ArtifactCoordinates createArtifactCoordinates(String groupId, String artifactId, String version, String extension) Shortcut forgetService(ArtifactCoordinatesFactory.class).create(...)- Specified by:
- createArtifactCoordinatesin interface- Session
- See Also:
 
- 
createArtifactCoordinatesShortcut forgetService(ArtifactCoordinatesFactory.class).create(...)- Specified by:
- createArtifactCoordinatesin interface- Session
- See Also:
 
- 
createArtifactCoordinatespublic ArtifactCoordinates createArtifactCoordinates(String groupId, String artifactId, String version, String classifier, String extension, String type) Shortcut forgetService(ArtifactCoordinatesFactory.class).create(...)- Specified by:
- createArtifactCoordinatesin interface- Session
- See Also:
 
- 
createArtifactCoordinatesShortcut forgetService(ArtifactCoordinatesFactory.class).create(...)- Specified by:
- createArtifactCoordinatesin interface- Session
- See Also:
 
- 
createArtifact
- 
createArtifact
- 
createProducedArtifactpublic ProducedArtifact createProducedArtifact(String groupId, String artifactId, String version, String extension) Shortcut forgetService(ArtifactFactory.class).createProduced(...)- Specified by:
- createProducedArtifactin interface- Session
- See Also:
 
- 
createProducedArtifactpublic ProducedArtifact createProducedArtifact(String groupId, String artifactId, String version, String classifier, String extension, String type) Shortcut forgetService(ArtifactFactory.class).createProduced(...)- Specified by:
- createProducedArtifactin interface- Session
- See Also:
 
- 
resolveArtifactShortcut forgetService(ArtifactResolver.class).resolve(...)- Specified by:
- resolveArtifactin interface- Session
- Throws:
- ArtifactResolverException- if the artifact resolution failed
- See Also:
 
- 
resolveArtifactpublic DownloadedArtifact resolveArtifact(ArtifactCoordinates coordinates, List<RemoteRepository> repositories) Shortcut forgetService(ArtifactResolver.class).resolve(...)- Specified by:
- resolveArtifactin interface- Session
- Throws:
- ArtifactResolverException- if the artifact resolution failed
- See Also:
 
- 
resolveArtifactsShortcut forgetService(ArtifactResolver.class).resolve(...)- Specified by:
- resolveArtifactsin interface- Session
- Throws:
- ArtifactResolverException- if the artifact resolution failed
- See Also:
 
- 
resolveArtifactspublic Collection<DownloadedArtifact> resolveArtifacts(Collection<? extends ArtifactCoordinates> coordinates) Shortcut forgetService(ArtifactResolver.class).resolve(...)- Specified by:
- resolveArtifactsin interface- Session
- Throws:
- ArtifactResolverException- if the artifact resolution failed
- See Also:
 
- 
resolveArtifactspublic Collection<DownloadedArtifact> resolveArtifacts(Collection<? extends ArtifactCoordinates> coordinates, List<RemoteRepository> repositories) Shortcut forgetService(ArtifactResolver.class).resolve(...)- Specified by:
- resolveArtifactsin interface- Session
- Throws:
- ArtifactResolverException- if the artifact resolution failed
- See Also:
 
- 
resolveArtifactShortcut forgetService(ArtifactResolver.class).resolve(...)- Specified by:
- resolveArtifactin interface- Session
- Throws:
- ArtifactResolverException- if the artifact resolution failed
- See Also:
 
- 
resolveArtifactShortcut forgetService(ArtifactResolver.class).resolve(...)- Specified by:
- resolveArtifactin interface- Session
- Throws:
- ArtifactResolverException- if the artifact resolution failed
- See Also:
 
- 
resolveArtifacts- Specified by:
- resolveArtifactsin interface- Session
 
- 
installArtifactsShortcut forgetService(ArtifactInstaller.class).install(...)- Specified by:
- installArtifactsin interface- Session
- Throws:
- ArtifactInstallerException- if the artifacts installation failed
- See Also:
 
- 
installArtifactsShortcut forgetService(ArtifactInstaller.class).install(...)- Specified by:
- installArtifactsin interface- Session
- Throws:
- ArtifactInstallerException- if the artifacts installation failed
- See Also:
 
- 
deployArtifactShortcut forgetService(ArtifactDeployer.class).deploy(...)- Specified by:
- deployArtifactin interface- Session
- Throws:
- ArtifactDeployerException- if the artifacts deployment failed
- See Also:
 
- 
setArtifactPathShortcut forgetService(ArtifactManager.class).setPath(...)- Specified by:
- setArtifactPathin interface- Session
- See Also:
 
- 
getArtifactPath
- 
isVersionSnapshotShortcut forgetService(VersionParser.class).isSnapshot(...)- Specified by:
- isVersionSnapshotin interface- Session
- See Also:
 
- 
createDependencyCoordinates@Nonnull public DependencyCoordinates createDependencyCoordinates(@Nonnull ArtifactCoordinates coordinates) Shortcut forgetService(DependencyFactory.class).create(...)- Specified by:
- createDependencyCoordinatesin interface- Session
- See Also:
 
- 
createDependencyCoordinatesShortcut forgetService(DependencyFactory.class).create(...)- Specified by:
- createDependencyCoordinatesin interface- Session
- See Also:
 
- 
collectDependenciesShortcut forgetService(DependencyResolver.class).collect(...)- Specified by:
- collectDependenciesin interface- Session
- Throws:
- DependencyResolverException- if the dependency collection failed
- See Also:
 
- 
collectDependenciesShortcut forgetService(DependencyResolver.class).collect(...)- Specified by:
- collectDependenciesin interface- Session
- Throws:
- DependencyResolverException- if the dependency collection failed
- See Also:
 
- 
collectDependencies@Nonnull public Node collectDependencies(@Nonnull DependencyCoordinates dependency, @Nonnull PathScope scope) Shortcut forgetService(DependencyResolver.class).collect(...)- Specified by:
- collectDependenciesin interface- Session
- Throws:
- DependencyResolverException- if the dependency collection failed
- See Also:
 
- 
flattenDependencies
- 
resolveDependencies- Specified by:
- resolveDependenciesin interface- Session
 
- 
resolveDependencies- Specified by:
- resolveDependenciesin interface- Session
 
- 
resolveDependencies
- 
resolveDependenciespublic Map<PathType, List<Path>> resolveDependencies(@Nonnull DependencyCoordinates dependency, @Nonnull PathScope scope, @Nonnull Collection<PathType> desiredTypes) - Specified by:
- resolveDependenciesin interface- Session
 
- 
resolveDependencies
- 
getPathForLocalArtifact- Specified by:
- getPathForLocalArtifactin interface- Session
 
- 
getPathForRemoteArtifact- Specified by:
- getPathForRemoteArtifactin interface- Session
 
- 
parseVersion- Specified by:
- parseVersionin interface- Session
 
- 
parseVersionRange- Specified by:
- parseVersionRangein interface- Session
 
- 
parseVersionConstraint- Specified by:
- parseVersionConstraintin interface- Session
 
- 
resolveVersion- Specified by:
- resolveVersionin interface- Session
- Throws:
- VersionResolverException
 
- 
resolveVersionRangepublic List<Version> resolveVersionRange(ArtifactCoordinates artifact) throws VersionResolverException - Specified by:
- resolveVersionRangein interface- Session
- Throws:
- VersionResolverException
 
- 
resolveVersionRangepublic List<Version> resolveVersionRange(ArtifactCoordinates artifact, List<RemoteRepository> repositories) throws VersionResolverException - Specified by:
- resolveVersionRangein interface- Session
- Throws:
- VersionResolverException
 
- 
resolveHighestVersionpublic Optional<Version> resolveHighestVersion(ArtifactCoordinates artifact, List<RemoteRepository> repositories) throws VersionResolverException - Specified by:
- resolveHighestVersionin interface- Session
- Throws:
- VersionResolverException
 
- 
requireType- Specified by:
- requireTypein interface- Session
 
- 
requireLanguage- Specified by:
- requireLanguagein interface- Session
 
- 
requirePackaging- Specified by:
- requirePackagingin interface- Session
 
- 
requireProjectScope- Specified by:
- requireProjectScopein interface- Session
 
- 
requireDependencyScope- Specified by:
- requireDependencyScopein interface- Session
 
- 
requirePathScope- Specified by:
- requirePathScopein interface- Session
 
- 
setCurrentTraceDescription copied from interface:InternalSessionSets the current request trace for the session. The request trace provides contextual information about the current operation being performed and can be used for debugging and monitoring purposes. The trace is stored in thread-local storage, allowing for concurrent operations with different traces.- Specified by:
- setCurrentTracein interface- InternalSession
- Parameters:
- trace- the trace to set as current, may be null to clear the trace
- See Also:
 
- 
getCurrentTraceDescription copied from interface:InternalSessionGets the current request trace for the session from thread-local storage. Each thread maintains its own trace context, ensuring thread-safety for concurrent operations.- Specified by:
- getCurrentTracein interface- InternalSession
- Returns:
- the current request trace, or null if no trace is set
- See Also:
 
 
-