Package org.apache.maven.api.cli
Interface InvokerRequest<O extends Options>
- Type Parameters:
O- the type ofOptionsused for this request, extending the baseOptionsinterface
- All Known Subinterfaces:
EncryptInvokerRequest,ForkedMavenInvokerRequest,MavenInvokerRequest<O>
- All Known Implementing Classes:
BaseInvokerRequest,DefaultEncryptInvokerRequest,DefaultForkedMavenInvokerRequest,DefaultMavenInvokerRequest
Represents a Maven execution request, encapsulating all necessary information
for invoking a Maven build or command.
- Since:
- 4.0.0
-
Method Summary
Modifier and TypeMethodDescriptionReturns a list of core extensions, if configured in the .mvn/extensions.xml file.cwd()Returns the current working directory for the Maven execution.err()Returns the error stream for the Maven execution, if running in embedded mode.in()Returns the input stream for the Maven execution, if running in embedded mode.Returns the Maven installation directory.default Loggerlogger()Shorthand forLoggerto use.default Lookuplookup()Shorthand forLookup.default MessageBuilderFactoryShorthand forMessageBuilderFactory.options()Returns the options associated with this invocation request.out()Returns the output stream for the Maven execution, if running in embedded mode.The parser request this instance was created from.Returns the root directory of the Maven invocation, if found.Returns a map of system properties for the Maven execution.Returns the top-level directory of the Maven invocation.Returns the user's home directory.Returns a map of user-defined properties for the Maven execution.
-
Method Details
-
parserRequest
The parser request this instance was created from. -
logger
Shorthand forLoggerto use. -
messageBuilderFactory
Shorthand forMessageBuilderFactory. -
lookup
Shorthand forLookup. -
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
-
userProperties
Returns a map of user-defined properties for the Maven execution. These properties can be set using the -D command-line option.- Returns:
- an unmodifiable map of user properties
-
systemProperties
Returns a map of system properties for the Maven execution. These include both Java system properties and Maven-specific system properties.- Returns:
- an unmodifiable map of system properties
-
topDirectory
Returns the top-level directory of the Maven invocation. This is typically the directory containing the POM file being executed.- Returns:
- the top-level directory path
-
rootDirectory
Returns the root directory of the Maven invocation, if found. This is determined by the presence of a.mvndirectory or a POM with the root="true" property but is not always applicable (ie invocation from outside a checkout).- Returns:
- the root directory path, if present
-
in
Returns the input stream for the Maven execution, if running in embedded mode.- Returns:
- an
Optionalcontaining the input stream, or empty if not applicable
-
out
Returns the output stream for the Maven execution, if running in embedded mode.- Returns:
- an
Optionalcontaining the output stream, or empty if not applicable
-
err
Returns the error stream for the Maven execution, if running in embedded mode.- Returns:
- an
Optionalcontaining the error stream, or empty if not applicable
-
coreExtensions
Returns a list of core extensions, if configured in the .mvn/extensions.xml file.- Returns:
- an
Optionalcontaining the list of core extensions, or empty if not configured
-
options
Returns the options associated with this invocation request.- Returns:
- the options object
-