Package org.apache.maven.shared.invoker
Interface Invoker
- All Known Implementing Classes:
DefaultInvoker
public interface Invoker
Provides a facade to invoke Maven.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionexecute
(InvocationRequest request) Executes Maven using the parameters specified by the given invocation request.Gets the path to the base directory of the local repository to use for the Maven invocation.Gets the logger used by this invoker to output diagnostic messages.Get the customized File of the Maven executable.Gets the path to the base directory of the Maven installation used to invoke Maven.Gets the working directory for the Maven invocation.setErrorHandler
(InvocationOutputHandler errorHandler) Deprecated.setInputStream
(InputStream inputStream) Deprecated.setLocalRepositoryDirectory
(File localRepositoryDirectory) Sets the path to the base directory of the local repository to use for the Maven invocation.setLogger
(InvokerLogger logger) Sets the logger used by this invoker to output diagnostic messages.setMavenExecutable
(File mavenExecutable) mavenExecutable
can either be a file relative to ${maven.home}/bin/ or an absolute file.setMavenHome
(File mavenHome) Sets the path to the base directory of the Maven installation used to invoke Maven.setOutputHandler
(InvocationOutputHandler outputHandler) Deprecated.setWorkingDirectory
(File workingDirectory) Deprecated.Please useInvocationRequest.setBaseDirectory(File)
-
Field Details
-
ROLE
The role name used to register implementations of this interface within Plexus.
-
-
Method Details
-
getLocalRepositoryDirectory
File 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
null
to use the location from thesettings.xml
.
-
getWorkingDirectory
File getWorkingDirectory()Gets the working directory for the Maven invocation.- Returns:
- The working directory for the Maven invocation or
null
if the working directory is derived from the base directory of the processed POM.
-
getLogger
InvokerLogger 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
.
-
getMavenHome
File 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
null
if using the default Maven installation.
-
setMavenHome
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.home
.- Parameters:
mavenHome
- The path to the base directory of the Maven installation, may benull
to use the default Maven installation.- Returns:
- This invoker instance.
-
getMavenExecutable
File getMavenExecutable()Get the customized File of the Maven executable.- Returns:
- the custom Maven executable, otherwise
null
-
setMavenExecutable
mavenExecutable
can either be a file relative to ${maven.home}/bin/ or an absolute file.- Parameters:
mavenExecutable
- the executable- Returns:
- This invoker instance
-
setLocalRepositoryDirectory
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 ornull
to use the location from thesettings.xml
.- Returns:
- This invoker instance.
-
setWorkingDirectory
Deprecated.Please useInvocationRequest.setBaseDirectory(File)
Sets the working directory for the Maven invocation.- Parameters:
workingDirectory
- The working directory for the Maven invocation, may benull
to derive the working directory from the base directory of the processed POM.- Returns:
- This invoker instance.
-
setInputStream
Deprecated.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 benull
if not required.- Returns:
- This invoker instance.
InvocationRequest.setErrorHandler(InvocationOutputHandler)