Package org.apache.maven.api.cli
Interface Invoker
- All Superinterfaces:
- AutoCloseable
- All Known Implementing Classes:
- EncryptInvoker,- LookupInvoker,- MavenInvoker,- ResidentMavenInvoker,- ShellInvoker
Defines the contract for a component responsible for invoking a Maven application
 using the information provided in an 
InvokerRequest. This interface is central
 to the construction and invocation of Maven commands and builds, and it fully parses arguments.
 The Invoker is designed to be flexible, allowing for different implementations
 that can handle various types of InvokerRequests. It also implements
 AutoCloseable to ensure proper resource management.
- Since:
- 4.0.0
- 
Method SummaryModifier and TypeMethodDescriptiondefault voidclose()Closes and disposes of thisInvokerinstance, releasing any resources it may hold.intinvoke(InvokerRequest invokerRequest) Invokes the Maven application using the providedInvokerRequest.
- 
Method Details- 
invokeInvokes the Maven application using the providedInvokerRequest. This method is responsible for executing the Maven command or build process based on the information contained in the request.- Parameters:
- invokerRequest- the request containing all necessary information for the invocation
- Returns:
- an integer representing the exit code of the invocation (0 typically indicates success)
- Throws:
- InvokerException- if an error occurs during the invocation process.
 
- 
closeCloses and disposes of thisInvokerinstance, releasing any resources it may hold. This method is called automatically when using try-with-resources statements.The default implementation does nothing. Subclasses should override this method if they need to perform cleanup operations. - Specified by:
- closein interface- AutoCloseable
- Throws:
- InvokerException- if an error occurs while closing the- Invoker
 
 
-