Class DefaultSession

java.lang.Object
org.apache.maven.internal.impl.AbstractSession
org.apache.maven.internal.impl.DefaultSession
All Implemented Interfaces:
Session

public class DefaultSession extends AbstractSession
  • Constructor Details

  • Method Details

    • getMavenSession

      public MavenSession getMavenSession()
    • getLocalRepository

      @Nonnull public LocalRepository getLocalRepository()
    • getRemoteRepositories

      @Nonnull public List<RemoteRepository> getRemoteRepositories()
    • getSettings

      @Nonnull public Settings getSettings()
    • getUserProperties

      @Nonnull public Map<String,String> 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

      @Nonnull public Map<String,String> getSystemProperties()
      Description copied from interface: Session
      Gets the system properties to use for interpolation. The system properties are collected from the runtime environment such as System.getProperties() and environment variables.
      Returns:
      the system properties, never null
    • getMavenVersion

      @Nonnull public String getMavenVersion()
      Description copied from interface: Session
      Returns the current maven version
      Returns:
      the maven version, never null
    • getDegreeOfConcurrency

      public int getDegreeOfConcurrency()
    • getStartTime

      @Nonnull public Instant getStartTime()
    • getMultiModuleProjectDirectory

      @Nonnull public Path getMultiModuleProjectDirectory()
    • getExecutionRootDirectory

      @Nonnull public Path getExecutionRootDirectory()
    • getRootDirectory

      public Path 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

      public Path 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

      @Nonnull public List<Project> getProjects()
    • getPluginContext

      @Nonnull public Map<String,Object> getPluginContext(Project project)
      Description copied from interface: Session
      Returns the plugin context for mojo being executed and the specified Project, never returns null as if context not present, creates it. Implementation note: while this method return type is Map, the returned map instance implements ConcurrentMap as well.
    • getData

      @Nonnull public SessionData getData()
    • withLocalRepository

      @Nonnull public Session withLocalRepository(@Nonnull LocalRepository localRepository)
      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

      @Nonnull public Session withRemoteRepositories(@Nonnull List<RemoteRepository> repositories)
      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

      @Nonnull public <T extends Service> T getService(Class<T> clazz) throws NoSuchElementException
      Description copied from interface: Session
      Retrieves the service for the interface
      Throws:
      NoSuchElementException - if the service could not be found
    • getSession

      @Nonnull public org.eclipse.aether.RepositorySystemSession getSession()
    • getRepositorySystem

      @Nonnull public org.eclipse.aether.RepositorySystem getRepositorySystem()
    • toArtifactRepository

      public ArtifactRepository toArtifactRepository(RemoteRepository repository)
      Specified by:
      toArtifactRepository in class AbstractSession
    • toDependency

      public org.eclipse.aether.graph.Dependency toDependency(DependencyCoordinate dependency)
      Specified by:
      toDependency in class AbstractSession