Interface ProtoSession

All Known Subinterfaces:
InternalMavenSession, InternalSession, Session
All Known Implementing Classes:
AbstractSession, DefaultSession

@Experimental @ThreadSafe public interface ProtoSession
The proto session, material used to create Session.
Since:
4.0.0
  • Method Details

    • getUserProperties

      @Nonnull Map<String,String> getUserProperties()
      Returns immutable 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 Map<String,String> getSystemProperties()
      Returns immutable system properties to use for interpolation. The system properties are collected from the runtime environment such as System.getProperties() and environment variables (prefixed with env.).
      Returns:
      the system properties, never null
    • getStartTime

      @Nonnull Instant getStartTime()
      Returns the start time of the session.
      Returns:
      the start time as an Instant object, never null
    • getTopDirectory

      @Nonnull Path getTopDirectory()
      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.
      Returns:
      the directory of the topmost project, never null
      See Also:
    • getRootDirectory

      @Nonnull Path getRootDirectory()
      Gets the root directory of the session, which is the root directory for the top directory project.
      Returns:
      the root directory, never null
      Throws:
      IllegalStateException - if the root directory could not be found
      See Also:
    • toBuilder

      @Nonnull default ProtoSession.Builder toBuilder()
      Returns a proto session builder of this instance.
    • newBuilder

      static ProtoSession.Builder newBuilder()
      Returns new builder from scratch.