Package org.apache.maven.shared.invoker
Interface Invoker
- 
- All Known Implementing Classes:
- DefaultInvoker
 
 public interface InvokerProvides a facade to invoke Maven.
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description InvocationResultexecute(InvocationRequest request)Executes Maven using the parameters specified by the given invocation request.FilegetLocalRepositoryDirectory()Gets the path to the base directory of the local repository to use for the Maven invocation.InvokerLoggergetLogger()Gets the logger used by this invoker to output diagnostic messages.FilegetMavenExecutable()Get the customized File of the Maven executable.FilegetMavenHome()Gets the path to the base directory of the Maven installation used to invoke Maven.FilegetWorkingDirectory()Gets the working directory for the Maven invocation.InvokersetErrorHandler(InvocationOutputHandler errorHandler)Sets the handler used to capture the error output from the Maven build.InvokersetInputStream(InputStream inputStream)Sets the input stream used to provide input for the invoked Maven build.InvokersetLocalRepositoryDirectory(File localRepositoryDirectory)Sets the path to the base directory of the local repository to use for the Maven invocation.InvokersetLogger(InvokerLogger logger)Sets the logger used by this invoker to output diagnostic messages.InvokersetMavenExecutable(File mavenExecutable)mavenExecutablecan either be a file relative to ${maven.home}/bin/ or an absolute file.InvokersetMavenHome(File mavenHome)Sets the path to the base directory of the Maven installation used to invoke Maven.InvokersetOutputHandler(InvocationOutputHandler outputHandler)Sets the handler used to capture the standard output from the Maven build.InvokersetWorkingDirectory(File workingDirectory)Sets the working directory for the Maven invocation.
 
- 
- 
- 
Field Detail- 
ROLEstatic final String ROLE The role name used to register implementations of this interface within Plexus.
 
- 
 - 
Method Detail- 
executeInvocationResult execute(InvocationRequest request) throws MavenInvocationException Executes Maven using the parameters specified by the given invocation request. Parameters not specified by the invocation request will be derived from the state of this invoker instance. In case both the invoker instance and the invocation request provide a value for a particular option, the value from the invocation request dominates.- Parameters:
- request- The invocation request to execute, must not be- null.
- Returns:
- The result of the Maven invocation, never null.
- Throws:
- MavenInvocationException- if cannot configure correctly execution parameters
 
 - 
getLocalRepositoryDirectoryFile getLocalRepositoryDirectory() Gets the path to the base directory of the local repository to use for the Maven invocation.- Returns:
- The path to the base directory of the local repository or nullto use the location from thesettings.xml.
 
 - 
getWorkingDirectoryFile getWorkingDirectory() Gets the working directory for the Maven invocation.- Returns:
- The working directory for the Maven invocation or nullif the working directory is derived from the base directory of the processed POM.
 
 - 
getLoggerInvokerLogger getLogger() Gets the logger used by this invoker to output diagnostic messages.- Returns:
- The logger used by this invoker to output diagnostic messages, never null.
 
 - 
getMavenHomeFile getMavenHome() Gets the path to the base directory of the Maven installation used to invoke Maven.- Returns:
- The path to the base directory of the Maven installation or nullif using the default Maven installation.
 
 - 
setMavenHomeInvoker setMavenHome(File mavenHome) Sets the path to the base directory of the Maven installation used to invoke Maven. This parameter may be left unspecified to use the default Maven installation which will be discovered by evaluating the system propertymaven.homeand the environment variableM2_HOME.- Parameters:
- mavenHome- The path to the base directory of the Maven installation, may be- nullto use the default Maven installation.
- Returns:
- This invoker instance.
 
 - 
getMavenExecutableFile getMavenExecutable() Get the customized File of the Maven executable.- Returns:
- the custom Maven executable, otherwise null
 
 - 
setMavenExecutableInvoker setMavenExecutable(File mavenExecutable) mavenExecutablecan either be a file relative to ${maven.home}/bin/ or an absolute file.- Parameters:
- mavenExecutable- the executable
- Returns:
- This invoker instance
 
 - 
setLocalRepositoryDirectoryInvoker setLocalRepositoryDirectory(File localRepositoryDirectory) Sets the path to the base directory of the local repository to use for the Maven invocation.- Parameters:
- localRepositoryDirectory- The path to the base directory of the local repository or- nullto use the location from the- settings.xml.
- Returns:
- This invoker instance.
 
 - 
setLoggerInvoker setLogger(InvokerLogger logger) Sets the logger used by this invoker to output diagnostic messages.- Parameters:
- logger- The logger used by this invoker to output diagnostic messages, may be- nullto use a default logger.
- Returns:
- This invoker instance.
 
 - 
setWorkingDirectoryInvoker setWorkingDirectory(File workingDirectory) Sets the working directory for the Maven invocation.- Parameters:
- workingDirectory- The working directory for the Maven invocation, may be- nullto derive the working directory from the base directory of the processed POM.
- Returns:
- This invoker instance.
 
 - 
setInputStreamInvoker setInputStream(InputStream inputStream) Sets the input stream used to provide input for the invoked Maven build. This is in particular useful when invoking Maven in interactive mode.- Parameters:
- inputStream- The input stream used to provide input for the invoked Maven build, may be- nullif not required.
- Returns:
- This invoker instance.
 
 - 
setOutputHandlerInvoker setOutputHandler(InvocationOutputHandler outputHandler) Sets the handler used to capture the standard output from the Maven build.- Parameters:
- outputHandler- The output handler, may be- nullif the output is not of interest.
- Returns:
- This invoker instance.
 
 - 
setErrorHandlerInvoker setErrorHandler(InvocationOutputHandler errorHandler) Sets the handler used to capture the error output from the Maven build.- Parameters:
- errorHandler- The error handler, may be- nullif the output is not of interest.
- Returns:
- This invoker instance.
 
 
- 
 
-