org.apache.maven.shared.invoker
Class DefaultInvocationRequest

java.lang.Object
  extended by org.apache.maven.shared.invoker.DefaultInvocationRequest
All Implemented Interfaces:
InvocationRequest

public class DefaultInvocationRequest
extends Object
implements InvocationRequest

Specifies the parameters used to control a Maven invocation.

Version:
$Id: DefaultInvocationRequest.java 1392618 2012-10-01 21:20:53Z rfscholte $

Field Summary
 
Fields inherited from interface org.apache.maven.shared.invoker.InvocationRequest
CHECKSUM_POLICY_FAIL, CHECKSUM_POLICY_WARN, REACTOR_FAIL_AT_END, REACTOR_FAIL_FAST, REACTOR_FAIL_NEVER
 
Constructor Summary
DefaultInvocationRequest()
           
 
Method Summary
 InvocationRequest activateReactor(String[] includes, String[] excludes)
          Dynamically constructs a reactor using the subdirectories of the current directory
 InvocationRequest addShellEnvironment(String name, String value)
          Adds the specified environment variable to the Maven invocation.
 String[] getActivatedReactorExcludes()
          Gets the list of subdirectory patterns to exclude from search
 String[] getActivatedReactorIncludes()
          Gets the list of subdirectory patterns to search
 File getBaseDirectory()
          Gets the path to the base directory of the POM for the Maven invocation.
 File getBaseDirectory(File defaultDirectory)
          Gets the path to the base directory of the POM for the Maven invocation.
 InvocationOutputHandler getErrorHandler(InvocationOutputHandler defaultHandler)
          Gets the handler used to capture the error output from the Maven build.
 String getFailureBehavior()
          Gets the failure mode of the Maven invocation.
 String getGlobalChecksumPolicy()
          Gets the checksum mode of the Maven invocation.
 File getGlobalSettingsFile()
          Gets the path to the global settings for the Maven invocation.
 List<String> getGoals()
          Gets the goals for the Maven invocation.
 InputStream getInputStream(InputStream defaultStream)
          Gets the input stream used to provide input for the invoked Maven build.
 File getJavaHome()
          Gets the path to the base directory of the Java installation used to run Maven.
 File getLocalRepositoryDirectory(File defaultDirectory)
          Gets the path to the base directory of the local repository to use for the Maven invocation.
 String getMavenOpts()
          Gets the value of the MAVEN_OPTS environment variable.
 InvocationOutputHandler getOutputHandler(InvocationOutputHandler defaultHandler)
          Gets the handler used to capture the standard output from the Maven build.
 File getPomFile()
          Gets the path to the POM for the Maven invocation.
 String getPomFileName()
          Gets the (unqualified) filename of the POM for the Maven invocation.
 List<String> getProfiles()
          Gets the profiles for the Maven invocation.
 List<String> getProjects()
          A list of specified reactor projects to build instead of all projects.
 Properties getProperties()
          Gets the system properties for the Maven invocation.
 String getResumeFrom()
          Get the value of resume-from
 Map<String,String> getShellEnvironments()
          Gets the environment variables for the Maven invocation.
 String getThreads()
          Get the value of the threads argument.
 File getToolchainsFile()
          Gets the path to the custom toolchains file
 File getUserSettingsFile()
          Gets the path to the user settings for the Maven invocation.
 boolean isActivatedReactor()
          Gets whether Maven should search subdirectories to build a dynamic reactor
 boolean isAlsoMake()
          Get the value of the also-make argument.
 boolean isAlsoMakeDependents()
          Get the value of the also-make-dependents
 boolean isDebug()
          Gets the debug mode of the Maven invocation.
 boolean isInteractive()
          Gets the interaction mode of the Maven invocation.
 boolean isNonPluginUpdates()
          Indicates whether Maven should check for plugin updates.
 boolean isOffline()
          Gets the network mode of the Maven invocation.
 boolean isRecursive()
          Gets the recursion behavior of a reactor invocation.
 boolean isShellEnvironmentInherited()
          Indicates whether the environment variables of the current process should be propagated to the Maven invocation.
 boolean isShowErrors()
          Gets the exception output mode of the Maven invocation.
 boolean isShowVersion()
          The show version behaviour (-V option)
 boolean isUpdateSnapshots()
          Indicates whether Maven should enforce an update check for plugins and snapshots.
 InvocationRequest setAlsoMake(boolean alsoMake)
          Enable the 'also make' mode.
 InvocationRequest setAlsoMakeDependents(boolean alsoMakeDependents)
          Enable the 'also make dependents' mode.
 InvocationRequest setBaseDirectory(File basedir)
          Sets the path to the base directory of the POM for the Maven invocation.
 InvocationRequest setDebug(boolean debug)
          Sets the debug mode of the Maven invocation.
 InvocationRequest setErrorHandler(InvocationOutputHandler errorHandler)
          Sets the handler used to capture the error output from the Maven build.
 InvocationRequest setFailureBehavior(String failureBehavior)
          Sets the failure mode of the Maven invocation.
 InvocationRequest setGlobalChecksumPolicy(String globalChecksumPolicy)
          Sets the checksum mode of the Maven invocation.
 InvocationRequest setGlobalSettingsFile(File globalSettings)
          Sets the path to the global settings for the Maven invocation.
 InvocationRequest setGoals(List<String> goals)
          Sets the goals for the Maven invocation.
 InvocationRequest setInputStream(InputStream inputStream)
          Sets the input stream used to provide input for the invoked Maven build.
 InvocationRequest setInteractive(boolean interactive)
          Sets the interaction mode of the Maven invocation.
 InvocationRequest setJavaHome(File javaHome)
          Sets the path to the base directory of the Java installation used to run Maven.
 InvocationRequest setLocalRepositoryDirectory(File localRepository)
          Sets the path to the base directory of the local repository to use for the Maven invocation.
 InvocationRequest setMavenOpts(String mavenOpts)
          Sets the value of the MAVEN_OPTS environment variable.
 InvocationRequest setNonPluginUpdates(boolean nonPluginUpdates)
          Specifies whether Maven should check for plugin updates.
 InvocationRequest setOffline(boolean offline)
          Sets the network mode of the Maven invocation.
 InvocationRequest setOutputHandler(InvocationOutputHandler outputHandler)
          Sets the handler used to capture the standard output from the Maven build.
 InvocationRequest setPomFile(File pomFile)
          Sets the path to the POM for the Maven invocation.
 InvocationRequest setPomFileName(String pomFilename)
          Sets the (unqualified) filename of the POM for the Maven invocation.
 InvocationRequest setProfiles(List<String> profiles)
          Sets the profiles for the Maven invocation.
 InvocationRequest setProjects(List<String> projects)
          Sets the reactor project list.
 InvocationRequest setProperties(Properties properties)
          Sets the system properties for the Maven invocation.
 InvocationRequest setRecursive(boolean recursive)
          Sets the recursion behavior of a reactor invocation.
 InvocationRequest setResumeFrom(String resumeFrom)
          Resume reactor from specified project.
 InvocationRequest setShellEnvironmentInherited(boolean shellEnvironmentInherited)
          Specifies whether the environment variables of the current process should be propagated to the Maven invocation.
 InvocationRequest setShowErrors(boolean showErrors)
          Sets the exception output mode of the Maven invocation.
 InvocationRequest setShowVersion(boolean showVersion)
          enable displaying version without stopping the build Equivalent of -V or --show-version
 InvocationRequest setThreads(String threads)
          Thread count, for instance 2.0C where C is core multiplied Equivalent of -T or --threads note: available since Maven3
 InvocationRequest setToolchainsFile(File toolchains)
          Sets the alternate path for the user toolchains file Equivalent of -t or --toolchains note: available since Maven3
 InvocationRequest setUpdateSnapshots(boolean updateSnapshots)
          Specifies whether Maven should enforce an update check for plugins and snapshots.
 InvocationRequest setUserSettingsFile(File userSettings)
          Sets the path to the user settings for the Maven invocation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultInvocationRequest

public DefaultInvocationRequest()
Method Detail

activateReactor

public InvocationRequest activateReactor(String[] includes,
                                         String[] excludes)
Description copied from interface: InvocationRequest
Dynamically constructs a reactor using the subdirectories of the current directory

Specified by:
activateReactor in interface InvocationRequest
Parameters:
includes - a list of filename patterns to include, or null, in which case the default is */pom.xml
excludes - a list of filename patterns to exclude, or null, in which case nothing is excluded
Returns:
This invocation request

getBaseDirectory

public File getBaseDirectory()
Description copied from interface: InvocationRequest
Gets the path to the base directory of the POM for the Maven invocation. If InvocationRequest.getPomFile() does not return null, this setting only affects the working directory for the Maven invocation.

Specified by:
getBaseDirectory in interface InvocationRequest
Returns:
The path to the base directory of the POM or null if not set.

getBaseDirectory

public File getBaseDirectory(File defaultDirectory)
Description copied from interface: InvocationRequest
Gets the path to the base directory of the POM for the Maven invocation. If InvocationRequest.getPomFile() does not return null, this setting only affects the working directory for the Maven invocation.

Specified by:
getBaseDirectory in interface InvocationRequest
Parameters:
defaultDirectory - The default base directory to use if none is configured for this request, may be null.
Returns:
The path to the base directory of the POM or null if not set.

getErrorHandler

public InvocationOutputHandler getErrorHandler(InvocationOutputHandler defaultHandler)
Description copied from interface: InvocationRequest
Gets the handler used to capture the error output from the Maven build.

Specified by:
getErrorHandler in interface InvocationRequest
Returns:
The error handler or null if not set.

getFailureBehavior

public String getFailureBehavior()
Description copied from interface: InvocationRequest
Gets the failure mode of the Maven invocation. By default, the mode InvocationRequest.REACTOR_FAIL_FAST is used.

Specified by:
getFailureBehavior in interface InvocationRequest
Returns:
The failure mode, one of InvocationRequest.REACTOR_FAIL_FAST, InvocationRequest.REACTOR_FAIL_AT_END and InvocationRequest.REACTOR_FAIL_NEVER.

getGoals

public List<String> getGoals()
Description copied from interface: InvocationRequest
Gets the goals for the Maven invocation.

Specified by:
getGoals in interface InvocationRequest
Returns:
The goals for the Maven invocation or null if not set.

getInputStream

public InputStream getInputStream(InputStream defaultStream)
Description copied from interface: InvocationRequest
Gets the input stream used to provide input for the invoked Maven build. This is in particular useful when invoking Maven in interactive mode.

Specified by:
getInputStream in interface InvocationRequest
Returns:
The input stream used to provide input for the invoked Maven build or null if not set.

getLocalRepositoryDirectory

public File getLocalRepositoryDirectory(File defaultDirectory)
Description copied from interface: InvocationRequest
Gets the path to the base directory of the local repository to use for the Maven invocation.

Specified by:
getLocalRepositoryDirectory in interface InvocationRequest
Parameters:
defaultDirectory - The default location to use if no location is configured for this request, may be null.
Returns:
The path to the base directory of the local repository or null to use the location from the settings.xml.

getOutputHandler

public InvocationOutputHandler getOutputHandler(InvocationOutputHandler defaultHandler)
Description copied from interface: InvocationRequest
Gets the handler used to capture the standard output from the Maven build.

Specified by:
getOutputHandler in interface InvocationRequest
Returns:
The output handler or null if not set.

getPomFile

public File getPomFile()
Description copied from interface: InvocationRequest
Gets the path to the POM for the Maven invocation. If no base directory is set, the parent directory of this POM will be used as the working directory for the Maven invocation.

Specified by:
getPomFile in interface InvocationRequest
Returns:
The path to the POM for the Maven invocation or null if not set.

getProperties

public Properties getProperties()
Description copied from interface: InvocationRequest
Gets the system properties for the Maven invocation.

Specified by:
getProperties in interface InvocationRequest
Returns:
The system properties for the Maven invocation or null if not set.

isDebug

public boolean isDebug()
Description copied from interface: InvocationRequest
Gets the debug mode of the Maven invocation. By default, Maven is executed in normal mode.

Specified by:
isDebug in interface InvocationRequest
Returns:
true if Maven should be executed in debug mode, false if the normal mode should be used.

isInteractive

public boolean isInteractive()
Description copied from interface: InvocationRequest
Gets the interaction mode of the Maven invocation. By default, Maven is executed in batch mode.

Specified by:
isInteractive in interface InvocationRequest
Returns:
true if Maven should be executed in interactive mode, false if the batch mode is used.

isOffline

public boolean isOffline()
Description copied from interface: InvocationRequest
Gets the network mode of the Maven invocation. By default, Maven is executed in online mode.

Specified by:
isOffline in interface InvocationRequest
Returns:
true if Maven should be executed in offline mode, false if the online mode is used.

isShowErrors

public boolean isShowErrors()
Description copied from interface: InvocationRequest
Gets the exception output mode of the Maven invocation. By default, Maven will not print stack traces of build exceptions.

Specified by:
isShowErrors in interface InvocationRequest
Returns:
true if Maven should print stack traces, false otherwise.

isUpdateSnapshots

public boolean isUpdateSnapshots()
Description copied from interface: InvocationRequest
Indicates whether Maven should enforce an update check for plugins and snapshots. By default, no update check is performed.

Specified by:
isUpdateSnapshots in interface InvocationRequest
Returns:
true if plugins and snapshots should be updated, false otherwise.

isRecursive

public boolean isRecursive()
Description copied from interface: InvocationRequest
Gets the recursion behavior of a reactor invocation. By default, Maven will recursive the build into sub modules.

Specified by:
isRecursive in interface InvocationRequest
Returns:
true if sub modules should be build, false otherwise.

setRecursive

public InvocationRequest setRecursive(boolean recursive)
Description copied from interface: InvocationRequest
Sets the recursion behavior of a reactor invocation. Inverse equivalent of -N and --non-recursive

Specified by:
setRecursive in interface InvocationRequest
Parameters:
recursive - true if sub modules should be build, false otherwise.
Returns:
This invocation request.

setBaseDirectory

public InvocationRequest setBaseDirectory(File basedir)
Description copied from interface: InvocationRequest
Sets the path to the base directory of the POM for the Maven invocation. If InvocationRequest.getPomFile() does not return null, this setting only affects the working directory for the Maven invocation.

Specified by:
setBaseDirectory in interface InvocationRequest
Parameters:
basedir - The path to the base directory of the POM, may be null if not used.
Returns:
This invocation request.

setDebug

public InvocationRequest setDebug(boolean debug)
Description copied from interface: InvocationRequest
Sets the debug mode of the Maven invocation. Equivalent of -X and --debug

Specified by:
setDebug in interface InvocationRequest
Parameters:
debug - true if Maven should be executed in debug mode, false if the normal mode should be used.
Returns:
This invocation request.

setErrorHandler

public InvocationRequest setErrorHandler(InvocationOutputHandler errorHandler)
Description copied from interface: InvocationRequest
Sets the handler used to capture the error output from the Maven build.

Specified by:
setErrorHandler in interface InvocationRequest
Parameters:
errorHandler - The error handler, may be null if the output is not of interest.
Returns:
This invocation request.

setFailureBehavior

public InvocationRequest setFailureBehavior(String failureBehavior)
Description copied from interface: InvocationRequest
Sets the failure mode of the Maven invocation. Equivalent of -ff and --fail-fast, -fae and --fail-at-end, -fn and --fail-never

Specified by:
setFailureBehavior in interface InvocationRequest
Parameters:
failureBehavior - The failure mode, must be one of InvocationRequest.REACTOR_FAIL_FAST, InvocationRequest.REACTOR_FAIL_AT_END and InvocationRequest.REACTOR_FAIL_NEVER.
Returns:
This invocation request.

setGoals

public InvocationRequest setGoals(List<String> goals)
Description copied from interface: InvocationRequest
Sets the goals for the Maven invocation.

Specified by:
setGoals in interface InvocationRequest
Parameters:
goals - The goals for the Maven invocation, may be null to execute the POMs default goal.
Returns:
This invocation request.

setInputStream

public InvocationRequest setInputStream(InputStream inputStream)
Description copied from interface: InvocationRequest
Sets the input stream used to provide input for the invoked Maven build. This is in particular useful when invoking Maven in interactive mode.

Specified by:
setInputStream in interface InvocationRequest
Parameters:
inputStream - The input stream used to provide input for the invoked Maven build, may be null if not required.
Returns:
This invocation request.

setInteractive

public InvocationRequest setInteractive(boolean interactive)
Description copied from interface: InvocationRequest
Sets the interaction mode of the Maven invocation. Inverse equivalent of -B and --batch-mode

Specified by:
setInteractive in interface InvocationRequest
Parameters:
interactive - true if Maven should be executed in interactive mode, false if the batch mode is used.
Returns:
This invocation request.

setLocalRepositoryDirectory

public InvocationRequest setLocalRepositoryDirectory(File localRepository)
Description copied from interface: InvocationRequest
Sets the path to the base directory of the local repository to use for the Maven invocation.

Specified by:
setLocalRepositoryDirectory in interface InvocationRequest
Parameters:
localRepository - The path to the base directory of the local repository, may be null.
Returns:
This invocation request.

setOffline

public InvocationRequest setOffline(boolean offline)
Description copied from interface: InvocationRequest
Sets the network mode of the Maven invocation. Equivalent of -o and --offline

Specified by:
setOffline in interface InvocationRequest
Parameters:
offline - true if Maven should be executed in offline mode, false if the online mode is used.
Returns:
This invocation request.

setOutputHandler

public InvocationRequest setOutputHandler(InvocationOutputHandler outputHandler)
Description copied from interface: InvocationRequest
Sets the handler used to capture the standard output from the Maven build.

Specified by:
setOutputHandler in interface InvocationRequest
Parameters:
outputHandler - The output handler, may be null if the output is not of interest.
Returns:
This invocation request.

setPomFile

public InvocationRequest setPomFile(File pomFile)
Description copied from interface: InvocationRequest
Sets the path to the POM for the Maven invocation. If no base directory is set, the parent directory of this POM will be used as the working directory for the Maven invocation.

Specified by:
setPomFile in interface InvocationRequest
Parameters:
pomFile - The path to the POM for the Maven invocation, may be null if not used.
Returns:
This invocation request.

setProperties

public InvocationRequest setProperties(Properties properties)
Description copied from interface: InvocationRequest
Sets the system properties for the Maven invocation.

Specified by:
setProperties in interface InvocationRequest
Parameters:
properties - The system properties for the Maven invocation, may be null if not set.
Returns:
This invocation request.

setShowErrors

public InvocationRequest setShowErrors(boolean showErrors)
Description copied from interface: InvocationRequest
Sets the exception output mode of the Maven invocation. Equivalent of -e and --errors

Specified by:
setShowErrors in interface InvocationRequest
Parameters:
showErrors - true if Maven should print stack traces, false otherwise.
Returns:
This invocation request.

setUpdateSnapshots

public InvocationRequest setUpdateSnapshots(boolean updateSnapshots)
Description copied from interface: InvocationRequest
Specifies whether Maven should enforce an update check for plugins and snapshots. Equivalent of -U and --update-snapshots

Specified by:
setUpdateSnapshots in interface InvocationRequest
Parameters:
updateSnapshots - true if plugins and snapshots should be updated, false otherwise.
Returns:
This invocation request.

isShellEnvironmentInherited

public boolean isShellEnvironmentInherited()
Description copied from interface: InvocationRequest
Indicates whether the environment variables of the current process should be propagated to the Maven invocation. By default, the current environment variables are inherited by the new Maven invocation.

Specified by:
isShellEnvironmentInherited in interface InvocationRequest
Returns:
true if the environment variables should be propagated, false otherwise.

setShellEnvironmentInherited

public InvocationRequest setShellEnvironmentInherited(boolean shellEnvironmentInherited)
Description copied from interface: InvocationRequest
Specifies whether the environment variables of the current process should be propagated to the Maven invocation.

Specified by:
setShellEnvironmentInherited in interface InvocationRequest
Parameters:
shellEnvironmentInherited - true if the environment variables should be propagated, false otherwise.
Returns:
This invocation request.

getJavaHome

public File getJavaHome()
Description copied from interface: InvocationRequest
Gets the path to the base directory of the Java installation used to run Maven.

Specified by:
getJavaHome in interface InvocationRequest
Returns:
The path to the base directory of the Java installation used to run Maven or null to use the default Java home.

setJavaHome

public InvocationRequest setJavaHome(File javaHome)
Description copied from interface: InvocationRequest
Sets the path to the base directory of the Java installation used to run Maven.

Specified by:
setJavaHome in interface InvocationRequest
Parameters:
javaHome - The path to the base directory of the Java installation used to run Maven, may be null to use the default Java home.
Returns:
This invocation request.

getUserSettingsFile

public File getUserSettingsFile()
Description copied from interface: InvocationRequest
Gets the path to the user settings for the Maven invocation.

Specified by:
getUserSettingsFile in interface InvocationRequest
Returns:
The path to the user settings for the Maven invocation or null to load the user settings from the default location.

setUserSettingsFile

public InvocationRequest setUserSettingsFile(File userSettings)
Description copied from interface: InvocationRequest
Sets the path to the user settings for the Maven invocation. Equivalent of -s and --settings

Specified by:
setUserSettingsFile in interface InvocationRequest
Parameters:
userSettings - The path to the user settings for the Maven invocation, may be null to load the user settings from the default location.
Returns:
This invocation request.

getGlobalSettingsFile

public File getGlobalSettingsFile()
Description copied from interface: InvocationRequest
Gets the path to the global settings for the Maven invocation.

Specified by:
getGlobalSettingsFile in interface InvocationRequest
Returns:
The path to the global settings for the Maven invocation or null to load the global settings from the default location.

setGlobalSettingsFile

public InvocationRequest setGlobalSettingsFile(File globalSettings)
Description copied from interface: InvocationRequest
Sets the path to the global settings for the Maven invocation. Equivalent of -gs and --global-settings

Specified by:
setGlobalSettingsFile in interface InvocationRequest
Parameters:
globalSettings - The path to the global settings for the Maven invocation, may be null to load the global settings from the default location.
Returns:
This invocation request.

getToolchainsFile

public File getToolchainsFile()
Description copied from interface: InvocationRequest
Gets the path to the custom toolchains file

Specified by:
getToolchainsFile in interface InvocationRequest
Returns:
The path to the custom toolchains file or null to load the toolchains from the default location

setToolchainsFile

public InvocationRequest setToolchainsFile(File toolchains)
Description copied from interface: InvocationRequest
Sets the alternate path for the user toolchains file Equivalent of -t or --toolchains

note: available since Maven3

Specified by:
setToolchainsFile in interface InvocationRequest
Parameters:
toolchains - the alternate path for the user toolchains file
Returns:
This invocation request

getGlobalChecksumPolicy

public String getGlobalChecksumPolicy()
Description copied from interface: InvocationRequest
Gets the checksum mode of the Maven invocation.

Specified by:
getGlobalChecksumPolicy in interface InvocationRequest
Returns:
The checksum mode, one of InvocationRequest.CHECKSUM_POLICY_WARN and InvocationRequest.CHECKSUM_POLICY_FAIL.

setGlobalChecksumPolicy

public InvocationRequest setGlobalChecksumPolicy(String globalChecksumPolicy)
Description copied from interface: InvocationRequest
Sets the checksum mode of the Maven invocation. Equivalent of -c or --lax-checksums, -C or --strict-checksums

Specified by:
setGlobalChecksumPolicy in interface InvocationRequest
Parameters:
globalChecksumPolicy - The checksum mode, must be one of InvocationRequest.CHECKSUM_POLICY_WARN and InvocationRequest.CHECKSUM_POLICY_FAIL.
Returns:
This invocation request.

getPomFileName

public String getPomFileName()
Description copied from interface: InvocationRequest
Gets the (unqualified) filename of the POM for the Maven invocation. This setting is ignored if InvocationRequest.getPomFile() does not return null. Otherwise, the base directory is assumed to contain a POM with this name. By default, a file named pom.xml is used.

Specified by:
getPomFileName in interface InvocationRequest
Returns:
The (unqualified) filename of the POM for the Maven invocation or null if not set.

setPomFileName

public InvocationRequest setPomFileName(String pomFilename)
Description copied from interface: InvocationRequest
Sets the (unqualified) filename of the POM for the Maven invocation. This setting is ignored if InvocationRequest.getPomFile() does not return null. Otherwise, the base directory is assumed to contain a POM with this name.

Specified by:
setPomFileName in interface InvocationRequest
Parameters:
pomFilename - The (unqualified) filename of the POM for the Maven invocation, may be null if not used.
Returns:
This invocation request.

getProfiles

public List<String> getProfiles()
Description copied from interface: InvocationRequest
Gets the profiles for the Maven invocation.

Specified by:
getProfiles in interface InvocationRequest
Returns:
The profiles for the Maven invocation or null if not set.

setProfiles

public InvocationRequest setProfiles(List<String> profiles)
Description copied from interface: InvocationRequest
Sets the profiles for the Maven invocation. Equivalent of -P and --active-profiles

Specified by:
setProfiles in interface InvocationRequest
Parameters:
profiles - The profiles for the Maven invocation, may be null to use the default profiles.
Returns:
This invocation request.

isNonPluginUpdates

public boolean isNonPluginUpdates()
Description copied from interface: InvocationRequest
Indicates whether Maven should check for plugin updates. By default, plugin updates are not suppressed.

Specified by:
isNonPluginUpdates in interface InvocationRequest
Returns:
true if plugin updates should be suppressed, false otherwise.

setNonPluginUpdates

public InvocationRequest setNonPluginUpdates(boolean nonPluginUpdates)
Description copied from interface: InvocationRequest
Specifies whether Maven should check for plugin updates.

Equivalent of -npu or --no-plugin-updates
note: Ineffective with Maven3, only kept for backward compatibility

Specified by:
setNonPluginUpdates in interface InvocationRequest
Parameters:
nonPluginUpdates - true if plugin updates should be suppressed, false otherwise.
Returns:
This invocation request.

addShellEnvironment

public InvocationRequest addShellEnvironment(String name,
                                             String value)
Description copied from interface: InvocationRequest
Adds the specified environment variable to the Maven invocation.

Specified by:
addShellEnvironment in interface InvocationRequest
Parameters:
name - The name of the environment variable, must not be null.
value - The value of the environment variable, must not be null.
Returns:
This invocation request.

getShellEnvironments

public Map<String,String> getShellEnvironments()
Description copied from interface: InvocationRequest
Gets the environment variables for the Maven invocation.

Specified by:
getShellEnvironments in interface InvocationRequest
Returns:
The environment variables for the Maven invocation or null if not set.

getMavenOpts

public String getMavenOpts()
Description copied from interface: InvocationRequest
Gets the value of the MAVEN_OPTS environment variable.

Specified by:
getMavenOpts in interface InvocationRequest
Returns:
The value of the MAVEN_OPTS environment variable or null if not set.

setMavenOpts

public InvocationRequest setMavenOpts(String mavenOpts)
Description copied from interface: InvocationRequest
Sets the value of the MAVEN_OPTS environment variable.

Specified by:
setMavenOpts in interface InvocationRequest
Parameters:
mavenOpts - The value of the MAVEN_OPTS environment variable, may be null to use the default options.
Returns:
This invocation request.

isActivatedReactor

public boolean isActivatedReactor()
Description copied from interface: InvocationRequest
Gets whether Maven should search subdirectories to build a dynamic reactor

Specified by:
isActivatedReactor in interface InvocationRequest
Returns:
true if we should search subdirectories, false otherwise

getActivatedReactorIncludes

public String[] getActivatedReactorIncludes()
Description copied from interface: InvocationRequest
Gets the list of subdirectory patterns to search

Specified by:
getActivatedReactorIncludes in interface InvocationRequest
Returns:
list of subdirectory patterns to search, or null in which case defaults should be used

getActivatedReactorExcludes

public String[] getActivatedReactorExcludes()
Description copied from interface: InvocationRequest
Gets the list of subdirectory patterns to exclude from search

Specified by:
getActivatedReactorExcludes in interface InvocationRequest
Returns:
list of subdirectory patterns to exclude search, or null in which case nothing should be excluded

isShowVersion

public boolean isShowVersion()
Description copied from interface: InvocationRequest
The show version behaviour (-V option)

Specified by:
isShowVersion in interface InvocationRequest
Returns:
The show version behaviour
See Also:
InvocationRequest.isShowVersion()

setShowVersion

public InvocationRequest setShowVersion(boolean showVersion)
Description copied from interface: InvocationRequest
enable displaying version without stopping the build Equivalent of -V or --show-version

Specified by:
setShowVersion in interface InvocationRequest
Parameters:
showVersion - enable displaying version
Returns:
This invocation request.
See Also:
InvocationRequest.setShowVersion(boolean)

getThreads

public String getThreads()
Get the value of the threads argument.

Specified by:
getThreads in interface InvocationRequest
Returns:
the value of the threads argument or null if not set

setThreads

public InvocationRequest setThreads(String threads)
Thread count, for instance 2.0C where C is core multiplied Equivalent of -T or --threads

note: available since Maven3

Specified by:
setThreads in interface InvocationRequest
Parameters:
threads - the threadcount
Returns:
This invocation request.

getProjects

public List<String> getProjects()
A list of specified reactor projects to build instead of all projects. A project can be specified by [groupId]:artifactId or by its relative path.

Specified by:
getProjects in interface InvocationRequest
Returns:
the list of projects to add to reactor build, otherwise null

setProjects

public InvocationRequest setProjects(List<String> projects)
Sets the reactor project list. Equivalent of -P or --projects

Specified by:
setProjects in interface InvocationRequest
Parameters:
projects - the reactor project list
Returns:
This invocation request.

isAlsoMake

public boolean isAlsoMake()
Get the value of the also-make argument.

Specified by:
isAlsoMake in interface InvocationRequest
Returns:
true if the argument also-make was specified, otherwise false

setAlsoMake

public InvocationRequest setAlsoMake(boolean alsoMake)
Enable the 'also make' mode. Equivalent of -am or --also-make

Specified by:
setAlsoMake in interface InvocationRequest
Parameters:
alsoMake - enable 'also make' mode
Returns:
This invocation request.

isAlsoMakeDependents

public boolean isAlsoMakeDependents()
Get the value of the also-make-dependents

Specified by:
isAlsoMakeDependents in interface InvocationRequest
Returns:
true if the argument also-make-dependents was specified, otherwise false

setAlsoMakeDependents

public InvocationRequest setAlsoMakeDependents(boolean alsoMakeDependents)
Enable the 'also make dependents' mode. Equivalent of -amd or --also-make-dependents

Specified by:
setAlsoMakeDependents in interface InvocationRequest
Returns:
This invocation request.

getResumeFrom

public String getResumeFrom()
Get the value of resume-from

Specified by:
getResumeFrom in interface InvocationRequest
Returns:
specified reactor project to resume from

setResumeFrom

public InvocationRequest setResumeFrom(String resumeFrom)
Resume reactor from specified project. Equivalent of -rf or --resume-from

Specified by:
setResumeFrom in interface InvocationRequest
Parameters:
resumeFrom - set the project to resume from
Returns:
This invocation request


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.