Package org.apache.maven.api.cli
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
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe immutable list of arguments to pass to the command.command()
The command to execute, ie "mvn".cwd()
Returns the current working directory for the Maven execution.static Path
static ExecutorRequest.Builder
Returns new empty builder.static Path
getCanonicalPath
(Path path) Returns the Maven installation directory.Returns the list of extra JVM arguments to be passed to the forked process.static ExecutorRequest.Builder
mavenBuilder
(Path installationDirectory) Returns new builder pre-set to run Maven.default ExecutorRequest.Builder
ReturnsExecutorRequest.Builder
for this instance.Returns the user's home directory.
-
Method Details
-
command
The command to execute, ie "mvn". -
arguments
The immutable list of arguments to pass to the command. -
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
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
Returns the user's home directory. This is typically obtained from the "user.home" system property.- Returns:
- the user's home directory path
-
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
ReturnsExecutorRequest.Builder
for this instance. -
empyBuilder
Returns new empty builder. -
mavenBuilder
Returns new builder pre-set to run Maven. The discovery of maven home is attempted. -
discoverMavenHome
-
getCanonicalPath
-