Interface InternalSession

All Superinterfaces:
org.apache.maven.api.ProtoSession, org.apache.maven.api.Session
All Known Implementing Classes:
AbstractSession

public interface InternalSession extends org.apache.maven.api.Session
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.apache.maven.api.ProtoSession

    org.apache.maven.api.ProtoSession.Builder
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    associate(org.eclipse.aether.RepositorySystemSession rsession, org.apache.maven.api.Session session)
     
    from(org.apache.maven.api.Session session)
     
    from(org.eclipse.aether.RepositorySystemSession session)
     
    Map<Class<? extends org.apache.maven.api.Service>,Supplier<? extends org.apache.maven.api.Service>>
    Retrieves a map of all services.
    <T extends org.apache.maven.api.Artifact>
    T
    getArtifact(Class<T> clazz, org.eclipse.aether.artifact.Artifact artifact)
     
    org.apache.maven.api.Artifact
    getArtifact(org.eclipse.aether.artifact.Artifact artifact)
     
    org.apache.maven.api.services.RequestTrace
    Gets the current request trace for the session from thread-local storage.
    org.apache.maven.api.Dependency
    getDependency(org.eclipse.aether.graph.Dependency dependency)
     
    org.apache.maven.api.LocalRepository
    getLocalRepository(org.eclipse.aether.repository.LocalRepository repository)
     
    org.apache.maven.api.Node
    getNode(org.eclipse.aether.graph.DependencyNode node)
     
    org.apache.maven.api.Node
    getNode(org.eclipse.aether.graph.DependencyNode node, boolean verbose)
     
    org.apache.maven.api.RemoteRepository
    getRemoteRepository(org.eclipse.aether.repository.RemoteRepository repository)
     
    org.apache.maven.api.Repository
    getRepository(org.eclipse.aether.repository.ArtifactRepository repository)
     
    org.eclipse.aether.RepositorySystem
     
    org.eclipse.aether.RepositorySystemSession
     
    org.apache.maven.api.WorkspaceRepository
    getWorkspaceRepository(org.eclipse.aether.repository.WorkspaceRepository repository)
     
    <REQ extends org.apache.maven.api.services.Request<?>, REP extends org.apache.maven.api.services.Result<REQ>>
    REP
    request(REQ req, Function<REQ,REP> supplier)
    Executes and optionally caches a request using the provided supplier function.
    <REQ extends org.apache.maven.api.services.Request<?>, REP extends org.apache.maven.api.services.Result<REQ>>
    List<REP>
    requests(List<REQ> req, Function<List<REQ>,List<REP>> supplier)
     
    void
    setCurrentTrace(org.apache.maven.api.services.RequestTrace trace)
    Sets the current request trace for the session.
    org.eclipse.aether.artifact.Artifact
    toArtifact(org.apache.maven.api.Artifact artifact)
     
    org.eclipse.aether.artifact.Artifact
    toArtifact(org.apache.maven.api.ArtifactCoordinates coords)
     
    List<org.eclipse.aether.artifact.Artifact>
    toArtifacts(Collection<? extends org.apache.maven.api.Artifact> artifacts)
     
    List<org.eclipse.aether.graph.Dependency>
    toDependencies(Collection<org.apache.maven.api.DependencyCoordinates> dependencies, boolean managed)
     
    org.eclipse.aether.graph.Dependency
    toDependency(org.apache.maven.api.DependencyCoordinates dependency, boolean managed)
     
    List<org.eclipse.aether.repository.RemoteRepository>
    toRepositories(List<org.apache.maven.api.RemoteRepository> repositories)
     
    org.eclipse.aether.repository.LocalRepository
    toRepository(org.apache.maven.api.LocalRepository repository)
     
    org.eclipse.aether.repository.RemoteRepository
    toRepository(org.apache.maven.api.RemoteRepository repository)
     
    List<org.eclipse.aether.repository.RemoteRepository>
    toResolvingRepositories(List<org.apache.maven.api.RemoteRepository> repositories)
     

    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, 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

      static InternalSession from(org.apache.maven.api.Session session)
    • from

      static InternalSession from(org.eclipse.aether.RepositorySystemSession session)
    • associate

      static void associate(org.eclipse.aether.RepositorySystemSession rsession, org.apache.maven.api.Session session)
    • request

      <REQ extends org.apache.maven.api.services.Request<?>, REP extends org.apache.maven.api.services.Result<REQ>> REP request(REQ req, Function<REQ,REP> supplier)
      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 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)
      Throws:
      RuntimeException - Any exception thrown by the supplier will be cached and re-thrown on subsequent calls
    • requests

      <REQ extends org.apache.maven.api.services.Request<?>, REP extends org.apache.maven.api.services.Result<REQ>> List<REP> requests(List<REQ> req, Function<List<REQ>,List<REP>> supplier)
    • getRemoteRepository

      org.apache.maven.api.RemoteRepository getRemoteRepository(org.eclipse.aether.repository.RemoteRepository repository)
    • getLocalRepository

      org.apache.maven.api.LocalRepository getLocalRepository(org.eclipse.aether.repository.LocalRepository repository)
    • getWorkspaceRepository

      org.apache.maven.api.WorkspaceRepository getWorkspaceRepository(org.eclipse.aether.repository.WorkspaceRepository repository)
    • getRepository

      org.apache.maven.api.Repository getRepository(org.eclipse.aether.repository.ArtifactRepository repository)
    • getNode

      org.apache.maven.api.Node getNode(org.eclipse.aether.graph.DependencyNode node)
    • getNode

      org.apache.maven.api.Node getNode(org.eclipse.aether.graph.DependencyNode node, boolean verbose)
    • getArtifact

      @Nonnull org.apache.maven.api.Artifact getArtifact(@Nonnull org.eclipse.aether.artifact.Artifact artifact)
    • getArtifact

      @Nonnull <T extends org.apache.maven.api.Artifact> T getArtifact(@Nonnull Class<T> clazz, @Nonnull org.eclipse.aether.artifact.Artifact artifact)
    • getDependency

      @Nonnull org.apache.maven.api.Dependency getDependency(@Nonnull org.eclipse.aether.graph.Dependency dependency)
    • toRepositories

      List<org.eclipse.aether.repository.RemoteRepository> toRepositories(List<org.apache.maven.api.RemoteRepository> repositories)
    • toResolvingRepositories

      List<org.eclipse.aether.repository.RemoteRepository> toResolvingRepositories(List<org.apache.maven.api.RemoteRepository> repositories)
    • toRepository

      org.eclipse.aether.repository.RemoteRepository toRepository(org.apache.maven.api.RemoteRepository repository)
    • toRepository

      org.eclipse.aether.repository.LocalRepository toRepository(org.apache.maven.api.LocalRepository repository)
    • toDependencies

      List<org.eclipse.aether.graph.Dependency> toDependencies(Collection<org.apache.maven.api.DependencyCoordinates> dependencies, boolean managed)
    • toDependency

      org.eclipse.aether.graph.Dependency toDependency(org.apache.maven.api.DependencyCoordinates dependency, boolean managed)
    • toArtifacts

      List<org.eclipse.aether.artifact.Artifact> toArtifacts(Collection<? extends org.apache.maven.api.Artifact> artifacts)
    • toArtifact

      org.eclipse.aether.artifact.Artifact toArtifact(org.apache.maven.api.Artifact artifact)
    • toArtifact

      org.eclipse.aether.artifact.Artifact toArtifact(org.apache.maven.api.ArtifactCoordinates coords)
    • getSession

      org.eclipse.aether.RepositorySystemSession getSession()
    • getRepositorySystem

      org.eclipse.aether.RepositorySystem getRepositorySystem()
    • setCurrentTrace

      void setCurrentTrace(@Nullable org.apache.maven.api.services.RequestTrace trace)
      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

      org.apache.maven.api.services.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:
    • getAllServices

      @Nonnull Map<Class<? extends org.apache.maven.api.Service>,Supplier<? extends org.apache.maven.api.Service>> getAllServices()
      Retrieves a map of all services.
      See Also:
      • Session.getService(Class)