Interface ExecutorRequest


@Immutable @Experimental public interface ExecutorRequest
Represents a request to execute Maven with command-line arguments. This interface encapsulates all the necessary information needed to execute Maven command with arguments. The arguments were not parsed, they are just passed over to executed tool.
Since:
4.0.0
  • Method Details

    • command

      @Nonnull String command()
      The command to execute, ie "mvn".
    • arguments

      @Nonnull List<String> arguments()
      The immutable list of arguments to pass to the command.
    • cwd

      @Nonnull Path cwd()
      Returns the current working directory for the Maven execution. This is typically the directory from which Maven was invoked.
      Returns:
      the current working directory path
    • installationDirectory

      @Nonnull Path installationDirectory()
      Returns the Maven installation directory. This is usually set by the Maven launcher script using the "maven.home" system property.
      Returns:
      the Maven installation directory path
    • userHomeDirectory

      @Nonnull Path userHomeDirectory()
      Returns the user's home directory. This is typically obtained from the "user.home" system property.
      Returns:
      the user's home directory path
    • jvmArguments

      @Nonnull Optional<List<String>> jvmArguments()
      Returns the list of extra JVM arguments to be passed to the forked process. These arguments allow for customization of the JVM environment in which tool will run. This property is used ONLY by executors and invokers that spawn a new JVM.
      Returns:
      an Optional containing the list of extra JVM arguments, or empty if not specified
    • toBuilder

      @Nonnull default ExecutorRequest.Builder toBuilder()
      Returns ExecutorRequest.Builder for this instance.
    • empyBuilder

      @Nonnull static ExecutorRequest.Builder empyBuilder()
      Returns new empty builder.
    • mavenBuilder

      @Nonnull static ExecutorRequest.Builder mavenBuilder(@Nullable Path installationDirectory)
      Returns new builder pre-set to run Maven. The discovery of maven home is attempted.
    • discoverMavenHome

      @Nonnull static Path discoverMavenHome()
    • getCanonicalPath

      @Nonnull static Path getCanonicalPath(Path path)