Package org.apache.maven.impl
Interface InternalSession
- All Superinterfaces:
ProtoSession
,Session
- All Known Subinterfaces:
InternalMavenSession
- All Known Implementing Classes:
AbstractSession
,DefaultSession
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.maven.api.ProtoSession
ProtoSession.Builder
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static InternalSession
static InternalSession
from
(org.eclipse.aether.RepositorySystemSession session) <T extends Artifact>
TgetArtifact
(Class<T> clazz, org.eclipse.aether.artifact.Artifact artifact) getArtifact
(org.eclipse.aether.artifact.Artifact artifact) Gets the current request trace for the session from thread-local storage.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) getRemoteRepository
(org.eclipse.aether.repository.RemoteRepository repository) getRepository
(org.eclipse.aether.repository.ArtifactRepository repository) org.eclipse.aether.RepositorySystem
org.eclipse.aether.RepositorySystemSession
getWorkspaceRepository
(org.eclipse.aether.repository.WorkspaceRepository repository) Executes and optionally caches a request using the provided supplier function.void
setCurrentTrace
(RequestTrace trace) Sets the current request trace for the session.org.eclipse.aether.artifact.Artifact
toArtifact
(Artifact artifact) org.eclipse.aether.artifact.Artifact
toArtifact
(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.Dependency
toDependency
(DependencyCoordinates dependency, boolean managed) List<org.eclipse.aether.repository.RemoteRepository>
toRepositories
(List<RemoteRepository> repositories) org.eclipse.aether.repository.LocalRepository
toRepository
(LocalRepository repository) org.eclipse.aether.repository.RemoteRepository
toRepository
(RemoteRepository repository) Methods inherited from interface org.apache.maven.api.ProtoSession
getRootDirectory, getStartTime, getSystemProperties, getTopDirectory, getUserProperties, toBuilder
Methods 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, getDegreeOfConcurrency, getEffectiveProperties, getListeners, getLocalRepository, getMavenVersion, getPathForLocalArtifact, getPathForRemoteArtifact, getPluginContext, getProjects, getRemoteRepositories, getService, getSettings, getToolchains, 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, resolveHighestVersion, resolveVersion, resolveVersionRange, resolveVersionRange, setArtifactPath, unregisterListener, withLocalRepository, withRemoteRepositories
-
Method Details
-
from
-
from
-
associate
-
request
Executes 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.- Type Parameters:
REQ
- The request typeREP
- The response type- Parameters:
req
- The request object used as the cache keysupplier
- The function to execute and cache the result- Returns:
- The result from the supplier (either fresh or cached)
- Throws:
RuntimeException
- Any exception thrown by the supplier will be cached and re-thrown on subsequent calls
-
requests
-
getRemoteRepository
-
getLocalRepository
-
getWorkspaceRepository
WorkspaceRepository getWorkspaceRepository(org.eclipse.aether.repository.WorkspaceRepository repository) -
getRepository
-
getNode
-
getNode
-
getArtifact
-
getArtifact
-
getDependency
-
toRepositories
List<org.eclipse.aether.repository.RemoteRepository> toRepositories(List<RemoteRepository> repositories) -
toRepository
-
toRepository
-
toDependencies
List<org.eclipse.aether.graph.Dependency> toDependencies(Collection<DependencyCoordinates> dependencies, boolean managed) -
toDependency
-
toArtifacts
-
toArtifact
-
toArtifact
-
getSession
org.eclipse.aether.RepositorySystemSession getSession() -
getRepositorySystem
org.eclipse.aether.RepositorySystem getRepositorySystem() -
setCurrentTrace
Sets 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.- Parameters:
trace
- the trace to set as current, may be null to clear the trace- See Also:
-
getCurrentTrace
RequestTrace getCurrentTrace()Gets the current request trace for the session from thread-local storage. Each thread maintains its own trace context, ensuring thread-safety for concurrent operations.- Returns:
- the current request trace, or null if no trace is set
- See Also:
-