Package org.apache.maven.shared.invoker
Class DefaultInvocationRequest
- java.lang.Object
-
- org.apache.maven.shared.invoker.DefaultInvocationRequest
-
- All Implemented Interfaces:
InvocationRequest
public class DefaultInvocationRequest extends java.lang.Object implements InvocationRequest
Specifies the parameters used to control a Maven invocation.- Version:
- $Id: DefaultInvocationRequest.java 1666746 2015-03-14 21:06:58Z rfscholte $
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
activatedReactor
private java.lang.String[]
activatedReactorExcludes
private java.lang.String[]
activatedReactorIncludes
private boolean
alsoMake
private boolean
alsoMakeDependents
private java.io.File
basedir
private boolean
debug
private InvocationOutputHandler
errorHandler
private java.lang.String
failureBehavior
private java.lang.String
globalChecksumPolicy
private java.io.File
globalSettings
private java.util.List<java.lang.String>
goals
private java.io.InputStream
inputStream
private boolean
interactive
private java.io.File
javaHome
private java.io.File
localRepository
private java.lang.String
mavenOpts
private boolean
nonPluginUpdates
private boolean
offline
private InvocationOutputHandler
outputHandler
private java.io.File
pomFile
private java.lang.String
pomFilename
private java.util.List<java.lang.String>
profiles
private java.util.List<java.lang.String>
projects
private java.util.Properties
properties
private boolean
recursive
private java.lang.String
resumeFrom
private boolean
shellEnvironmentInherited
private java.util.Map<java.lang.String,java.lang.String>
shellEnvironments
private boolean
showErrors
private boolean
showVersion
private java.lang.String
threads
private java.io.File
toolchains
private boolean
updateSnapshots
private java.io.File
userSettings
-
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
Constructors Constructor Description DefaultInvocationRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InvocationRequest
activateReactor(java.lang.String[] includes, java.lang.String[] excludes)
Dynamically constructs a reactor using the subdirectories of the current directoryInvocationRequest
addShellEnvironment(java.lang.String name, java.lang.String value)
Adds the specified environment variable to the Maven invocation.java.lang.String[]
getActivatedReactorExcludes()
Gets the list of subdirectory patterns to exclude from searchjava.lang.String[]
getActivatedReactorIncludes()
Gets the list of subdirectory patterns to searchjava.io.File
getBaseDirectory()
Gets the path to the base directory of the POM for the Maven invocation.java.io.File
getBaseDirectory(java.io.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.java.lang.String
getFailureBehavior()
Gets the failure mode of the Maven invocation.java.lang.String
getGlobalChecksumPolicy()
Gets the checksum mode of the Maven invocation.java.io.File
getGlobalSettingsFile()
Gets the path to the global settings for the Maven invocation.java.util.List<java.lang.String>
getGoals()
Gets the goals for the Maven invocation.java.io.InputStream
getInputStream(java.io.InputStream defaultStream)
Gets the input stream used to provide input for the invoked Maven build.java.io.File
getJavaHome()
Gets the path to the base directory of the Java installation used to run Maven.java.io.File
getLocalRepositoryDirectory(java.io.File defaultDirectory)
Gets the path to the base directory of the local repository to use for the Maven invocation.java.lang.String
getMavenOpts()
Gets the value of theMAVEN_OPTS
environment variable.InvocationOutputHandler
getOutputHandler(InvocationOutputHandler defaultHandler)
Gets the handler used to capture the standard output from the Maven build.java.io.File
getPomFile()
Gets the path to the POM for the Maven invocation.java.lang.String
getPomFileName()
Gets the (unqualified) filename of the POM for the Maven invocation.java.util.List<java.lang.String>
getProfiles()
Gets the profiles for the Maven invocation.java.util.List<java.lang.String>
getProjects()
A list of specified reactor projects to build instead of all projects.java.util.Properties
getProperties()
Gets the system properties for the Maven invocation.java.lang.String
getResumeFrom()
Get the value ofresume-from
java.util.Map<java.lang.String,java.lang.String>
getShellEnvironments()
Gets the environment variables for the Maven invocation.java.lang.String
getThreads()
Get the value of thethreads
argument.java.io.File
getToolchainsFile()
Gets the path to the custom toolchains filejava.io.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 reactorboolean
isAlsoMake()
Get the value of thealso-make
argument.boolean
isAlsoMakeDependents()
Get the value of thealso-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(java.io.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(java.lang.String failureBehavior)
Sets the failure mode of the Maven invocation.InvocationRequest
setGlobalChecksumPolicy(java.lang.String globalChecksumPolicy)
Sets the checksum mode of the Maven invocation.InvocationRequest
setGlobalSettingsFile(java.io.File globalSettings)
Sets the path to the global settings for the Maven invocation.InvocationRequest
setGoals(java.util.List<java.lang.String> goals)
Sets the goals for the Maven invocation.InvocationRequest
setInputStream(java.io.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(java.io.File javaHome)
Sets the path to the base directory of the Java installation used to run Maven.InvocationRequest
setLocalRepositoryDirectory(java.io.File localRepository)
Sets the path to the base directory of the local repository to use for the Maven invocation.InvocationRequest
setMavenOpts(java.lang.String mavenOpts)
Sets the value of theMAVEN_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(java.io.File pomFile)
Sets the path to the POM for the Maven invocation.InvocationRequest
setPomFileName(java.lang.String pomFilename)
Sets the (unqualified) filename of the POM for the Maven invocation.InvocationRequest
setProfiles(java.util.List<java.lang.String> profiles)
Sets the profiles for the Maven invocation.InvocationRequest
setProjects(java.util.List<java.lang.String> projects)
Sets the reactor project list.InvocationRequest
setProperties(java.util.Properties properties)
Sets the system properties for the Maven invocation.InvocationRequest
setRecursive(boolean recursive)
Sets the recursion behavior of a reactor invocation.InvocationRequest
setResumeFrom(java.lang.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(java.lang.String threads)
Thread count, for instance 2.0C where C is core multiplied Equivalent of-T
or--threads
InvocationRequest
setToolchainsFile(java.io.File toolchains)
Sets the alternate path for the user toolchains file Equivalent of-t
or--toolchains
InvocationRequest
setUpdateSnapshots(boolean updateSnapshots)
Specifies whether Maven should enforce an update check for plugins and snapshots.InvocationRequest
setUserSettingsFile(java.io.File userSettings)
Sets the path to the user settings for the Maven invocation.
-
-
-
Field Detail
-
basedir
private java.io.File basedir
-
debug
private boolean debug
-
errorHandler
private InvocationOutputHandler errorHandler
-
failureBehavior
private java.lang.String failureBehavior
-
goals
private java.util.List<java.lang.String> goals
-
inputStream
private java.io.InputStream inputStream
-
interactive
private boolean interactive
-
localRepository
private java.io.File localRepository
-
offline
private boolean offline
-
recursive
private boolean recursive
-
outputHandler
private InvocationOutputHandler outputHandler
-
pomFile
private java.io.File pomFile
-
properties
private java.util.Properties properties
-
showErrors
private boolean showErrors
-
updateSnapshots
private boolean updateSnapshots
-
shellEnvironmentInherited
private boolean shellEnvironmentInherited
-
userSettings
private java.io.File userSettings
-
globalSettings
private java.io.File globalSettings
-
toolchains
private java.io.File toolchains
-
globalChecksumPolicy
private java.lang.String globalChecksumPolicy
-
pomFilename
private java.lang.String pomFilename
-
javaHome
private java.io.File javaHome
-
profiles
private java.util.List<java.lang.String> profiles
-
nonPluginUpdates
private boolean nonPluginUpdates
-
shellEnvironments
private java.util.Map<java.lang.String,java.lang.String> shellEnvironments
-
mavenOpts
private java.lang.String mavenOpts
-
activatedReactor
private boolean activatedReactor
-
activatedReactorIncludes
private java.lang.String[] activatedReactorIncludes
-
activatedReactorExcludes
private java.lang.String[] activatedReactorExcludes
-
projects
private java.util.List<java.lang.String> projects
-
alsoMake
private boolean alsoMake
-
alsoMakeDependents
private boolean alsoMakeDependents
-
resumeFrom
private java.lang.String resumeFrom
-
showVersion
private boolean showVersion
-
threads
private java.lang.String threads
-
-
Method Detail
-
activateReactor
public InvocationRequest activateReactor(java.lang.String[] includes, java.lang.String[] excludes)
Description copied from interface:InvocationRequest
Dynamically constructs a reactor using the subdirectories of the current directory- Specified by:
activateReactor
in interfaceInvocationRequest
- Parameters:
includes
- a list of filename patterns to include, or null, in which case the default is */pom.xmlexcludes
- a list of filename patterns to exclude, or null, in which case nothing is excluded- Returns:
- This invocation request
-
getBaseDirectory
public java.io.File getBaseDirectory()
Description copied from interface:InvocationRequest
Gets the path to the base directory of the POM for the Maven invocation. IfInvocationRequest.getPomFile()
does not returnnull
, this setting only affects the working directory for the Maven invocation.- Specified by:
getBaseDirectory
in interfaceInvocationRequest
- Returns:
- The path to the base directory of the POM or
null
if not set.
-
getBaseDirectory
public java.io.File getBaseDirectory(java.io.File defaultDirectory)
Description copied from interface:InvocationRequest
Gets the path to the base directory of the POM for the Maven invocation. IfInvocationRequest.getPomFile()
does not returnnull
, this setting only affects the working directory for the Maven invocation.- Specified by:
getBaseDirectory
in interfaceInvocationRequest
- Parameters:
defaultDirectory
- The default base directory to use if none is configured for this request, may benull
.- 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 interfaceInvocationRequest
- Returns:
- The error handler or
null
if not set.
-
getFailureBehavior
public java.lang.String getFailureBehavior()
Description copied from interface:InvocationRequest
Gets the failure mode of the Maven invocation. By default, the modeInvocationRequest.REACTOR_FAIL_FAST
is used.- Specified by:
getFailureBehavior
in interfaceInvocationRequest
- Returns:
- The failure mode, one of
InvocationRequest.REACTOR_FAIL_FAST
,InvocationRequest.REACTOR_FAIL_AT_END
andInvocationRequest.REACTOR_FAIL_NEVER
.
-
getGoals
public java.util.List<java.lang.String> getGoals()
Description copied from interface:InvocationRequest
Gets the goals for the Maven invocation.- Specified by:
getGoals
in interfaceInvocationRequest
- Returns:
- The goals for the Maven invocation or
null
if not set.
-
getInputStream
public java.io.InputStream getInputStream(java.io.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 interfaceInvocationRequest
- Returns:
- The input stream used to provide input for the invoked Maven build or
null
if not set.
-
getLocalRepositoryDirectory
public java.io.File getLocalRepositoryDirectory(java.io.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 interfaceInvocationRequest
- Parameters:
defaultDirectory
- The default location to use if no location is configured for this request, may benull
.- Returns:
- The path to the base directory of the local repository or
null
to use the location from thesettings.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 interfaceInvocationRequest
- Returns:
- The output handler or
null
if not set.
-
getPomFile
public java.io.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 interfaceInvocationRequest
- Returns:
- The path to the POM for the Maven invocation or
null
if not set.
-
getProperties
public java.util.Properties getProperties()
Description copied from interface:InvocationRequest
Gets the system properties for the Maven invocation.- Specified by:
getProperties
in interfaceInvocationRequest
- 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 interfaceInvocationRequest
- 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 interfaceInvocationRequest
- 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 interfaceInvocationRequest
- 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 interfaceInvocationRequest
- 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 interfaceInvocationRequest
- 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 interfaceInvocationRequest
- 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 interfaceInvocationRequest
- Parameters:
recursive
-true
if sub modules should be build,false
otherwise.- Returns:
- This invocation request.
-
setBaseDirectory
public InvocationRequest setBaseDirectory(java.io.File basedir)
Description copied from interface:InvocationRequest
Sets the path to the base directory of the POM for the Maven invocation. IfInvocationRequest.getPomFile()
does not returnnull
, this setting only affects the working directory for the Maven invocation.- Specified by:
setBaseDirectory
in interfaceInvocationRequest
- Parameters:
basedir
- The path to the base directory of the POM, may benull
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 interfaceInvocationRequest
- 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 interfaceInvocationRequest
- Parameters:
errorHandler
- The error handler, may benull
if the output is not of interest.- Returns:
- This invocation request.
-
setFailureBehavior
public InvocationRequest setFailureBehavior(java.lang.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 interfaceInvocationRequest
- Parameters:
failureBehavior
- The failure mode, must be one ofInvocationRequest.REACTOR_FAIL_FAST
,InvocationRequest.REACTOR_FAIL_AT_END
andInvocationRequest.REACTOR_FAIL_NEVER
.- Returns:
- This invocation request.
-
setGoals
public InvocationRequest setGoals(java.util.List<java.lang.String> goals)
Description copied from interface:InvocationRequest
Sets the goals for the Maven invocation.- Specified by:
setGoals
in interfaceInvocationRequest
- Parameters:
goals
- The goals for the Maven invocation, may benull
to execute the POMs default goal.- Returns:
- This invocation request.
-
setInputStream
public InvocationRequest setInputStream(java.io.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 interfaceInvocationRequest
- Parameters:
inputStream
- The input stream used to provide input for the invoked Maven build, may benull
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 interfaceInvocationRequest
- 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(java.io.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 interfaceInvocationRequest
- Parameters:
localRepository
- The path to the base directory of the local repository, may benull
.- 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 interfaceInvocationRequest
- 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 interfaceInvocationRequest
- Parameters:
outputHandler
- The output handler, may benull
if the output is not of interest.- Returns:
- This invocation request.
-
setPomFile
public InvocationRequest setPomFile(java.io.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 interfaceInvocationRequest
- Parameters:
pomFile
- The path to the POM for the Maven invocation, may benull
if not used.- Returns:
- This invocation request.
-
setProperties
public InvocationRequest setProperties(java.util.Properties properties)
Description copied from interface:InvocationRequest
Sets the system properties for the Maven invocation.- Specified by:
setProperties
in interfaceInvocationRequest
- Parameters:
properties
- The system properties for the Maven invocation, may benull
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 interfaceInvocationRequest
- 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 interfaceInvocationRequest
- 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 interfaceInvocationRequest
- Returns:
true
if the environment variables should be propagated,false
otherwise.- See Also:
MavenCommandLineBuilder.setShellEnvironment(InvocationRequest, org.codehaus.plexus.util.cli.Commandline)
-
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 interfaceInvocationRequest
- Parameters:
shellEnvironmentInherited
-true
if the environment variables should be propagated,false
otherwise.- Returns:
- This invocation request.
-
getJavaHome
public java.io.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 interfaceInvocationRequest
- 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(java.io.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 interfaceInvocationRequest
- Parameters:
javaHome
- The path to the base directory of the Java installation used to run Maven, may benull
to use the default Java home.- Returns:
- This invocation request.
-
getUserSettingsFile
public java.io.File getUserSettingsFile()
Description copied from interface:InvocationRequest
Gets the path to the user settings for the Maven invocation.- Specified by:
getUserSettingsFile
in interfaceInvocationRequest
- 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(java.io.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 interfaceInvocationRequest
- Parameters:
userSettings
- The path to the user settings for the Maven invocation, may benull
to load the user settings from the default location.- Returns:
- This invocation request.
-
getGlobalSettingsFile
public java.io.File getGlobalSettingsFile()
Description copied from interface:InvocationRequest
Gets the path to the global settings for the Maven invocation.- Specified by:
getGlobalSettingsFile
in interfaceInvocationRequest
- 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(java.io.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 interfaceInvocationRequest
- Parameters:
globalSettings
- The path to the global settings for the Maven invocation, may benull
to load the global settings from the default location.- Returns:
- This invocation request.
-
getToolchainsFile
public java.io.File getToolchainsFile()
Description copied from interface:InvocationRequest
Gets the path to the custom toolchains file- Specified by:
getToolchainsFile
in interfaceInvocationRequest
- Returns:
- The path to the custom toolchains file or
null
to load the toolchains from the default location
-
setToolchainsFile
public InvocationRequest setToolchainsFile(java.io.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 interfaceInvocationRequest
- Parameters:
toolchains
- the alternate path for the user toolchains file- Returns:
- This invocation request
-
getGlobalChecksumPolicy
public java.lang.String getGlobalChecksumPolicy()
Description copied from interface:InvocationRequest
Gets the checksum mode of the Maven invocation.- Specified by:
getGlobalChecksumPolicy
in interfaceInvocationRequest
- Returns:
- The checksum mode, one of
InvocationRequest.CHECKSUM_POLICY_WARN
andInvocationRequest.CHECKSUM_POLICY_FAIL
.
-
setGlobalChecksumPolicy
public InvocationRequest setGlobalChecksumPolicy(java.lang.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 interfaceInvocationRequest
- Parameters:
globalChecksumPolicy
- The checksum mode, must be one ofInvocationRequest.CHECKSUM_POLICY_WARN
andInvocationRequest.CHECKSUM_POLICY_FAIL
.- Returns:
- This invocation request.
-
getPomFileName
public java.lang.String getPomFileName()
Description copied from interface:InvocationRequest
Gets the (unqualified) filename of the POM for the Maven invocation. This setting is ignored ifInvocationRequest.getPomFile()
does not returnnull
. Otherwise, the base directory is assumed to contain a POM with this name. By default, a file namedpom.xml
is used.- Specified by:
getPomFileName
in interfaceInvocationRequest
- Returns:
- The (unqualified) filename of the POM for the Maven invocation or
null
if not set.
-
setPomFileName
public InvocationRequest setPomFileName(java.lang.String pomFilename)
Description copied from interface:InvocationRequest
Sets the (unqualified) filename of the POM for the Maven invocation. This setting is ignored ifInvocationRequest.getPomFile()
does not returnnull
. Otherwise, the base directory is assumed to contain a POM with this name.- Specified by:
setPomFileName
in interfaceInvocationRequest
- Parameters:
pomFilename
- The (unqualified) filename of the POM for the Maven invocation, may benull
if not used.- Returns:
- This invocation request.
-
getProfiles
public java.util.List<java.lang.String> getProfiles()
Description copied from interface:InvocationRequest
Gets the profiles for the Maven invocation.- Specified by:
getProfiles
in interfaceInvocationRequest
- Returns:
- The profiles for the Maven invocation or
null
if not set.
-
setProfiles
public InvocationRequest setProfiles(java.util.List<java.lang.String> profiles)
Description copied from interface:InvocationRequest
Sets the profiles for the Maven invocation. Equivalent of-P
and--active-profiles
- Specified by:
setProfiles
in interfaceInvocationRequest
- Parameters:
profiles
- The profiles for the Maven invocation, may benull
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 interfaceInvocationRequest
- 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 interfaceInvocationRequest
- Parameters:
nonPluginUpdates
-true
if plugin updates should be suppressed,false
otherwise.- Returns:
- This invocation request.
-
addShellEnvironment
public InvocationRequest addShellEnvironment(java.lang.String name, java.lang.String value)
Description copied from interface:InvocationRequest
Adds the specified environment variable to the Maven invocation.- Specified by:
addShellEnvironment
in interfaceInvocationRequest
- Parameters:
name
- The name of the environment variable, must not benull
.value
- The value of the environment variable, must not benull
.- Returns:
- This invocation request.
-
getShellEnvironments
public java.util.Map<java.lang.String,java.lang.String> getShellEnvironments()
Description copied from interface:InvocationRequest
Gets the environment variables for the Maven invocation.- Specified by:
getShellEnvironments
in interfaceInvocationRequest
- Returns:
- The environment variables for the Maven invocation or
null
if not set.
-
getMavenOpts
public java.lang.String getMavenOpts()
Description copied from interface:InvocationRequest
Gets the value of theMAVEN_OPTS
environment variable.- Specified by:
getMavenOpts
in interfaceInvocationRequest
- Returns:
- The value of the
MAVEN_OPTS
environment variable ornull
if not set.
-
setMavenOpts
public InvocationRequest setMavenOpts(java.lang.String mavenOpts)
Description copied from interface:InvocationRequest
Sets the value of theMAVEN_OPTS
environment variable.- Specified by:
setMavenOpts
in interfaceInvocationRequest
- Parameters:
mavenOpts
- The value of theMAVEN_OPTS
environment variable, may benull
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 interfaceInvocationRequest
- Returns:
true
if we should search subdirectories,false
otherwise
-
getActivatedReactorIncludes
public java.lang.String[] getActivatedReactorIncludes()
Description copied from interface:InvocationRequest
Gets the list of subdirectory patterns to search- Specified by:
getActivatedReactorIncludes
in interfaceInvocationRequest
- Returns:
- list of subdirectory patterns to search, or
null
in which case defaults should be used
-
getActivatedReactorExcludes
public java.lang.String[] getActivatedReactorExcludes()
Description copied from interface:InvocationRequest
Gets the list of subdirectory patterns to exclude from search- Specified by:
getActivatedReactorExcludes
in interfaceInvocationRequest
- 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 interfaceInvocationRequest
- 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 interfaceInvocationRequest
- Parameters:
showVersion
- enable displaying version- Returns:
- This invocation request.
- See Also:
InvocationRequest.setShowVersion(boolean)
-
getThreads
public java.lang.String getThreads()
Get the value of thethreads
argument.- Specified by:
getThreads
in interfaceInvocationRequest
- Returns:
- the value of the
threads
argument ornull
if not set
-
setThreads
public InvocationRequest setThreads(java.lang.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 interfaceInvocationRequest
- Parameters:
threads
- the threadcount- Returns:
- This invocation request.
-
getProjects
public java.util.List<java.lang.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 interfaceInvocationRequest
- Returns:
- the list of projects to add to reactor build, otherwise
null
-
setProjects
public InvocationRequest setProjects(java.util.List<java.lang.String> projects)
Sets the reactor project list. Equivalent of-P
or--projects
- Specified by:
setProjects
in interfaceInvocationRequest
- Parameters:
projects
- the reactor project list- Returns:
- This invocation request.
-
isAlsoMake
public boolean isAlsoMake()
Get the value of thealso-make
argument.- Specified by:
isAlsoMake
in interfaceInvocationRequest
- Returns:
true
if the argumentalso-make
was specified, otherwisefalse
-
setAlsoMake
public InvocationRequest setAlsoMake(boolean alsoMake)
Enable the 'also make' mode. Equivalent of-am
or--also-make
- Specified by:
setAlsoMake
in interfaceInvocationRequest
- Parameters:
alsoMake
- enable 'also make' mode- Returns:
- This invocation request.
-
isAlsoMakeDependents
public boolean isAlsoMakeDependents()
Get the value of thealso-make-dependents
- Specified by:
isAlsoMakeDependents
in interfaceInvocationRequest
- Returns:
true
if the argumentalso-make-dependents
was specified, otherwisefalse
-
setAlsoMakeDependents
public InvocationRequest setAlsoMakeDependents(boolean alsoMakeDependents)
Enable the 'also make dependents' mode. Equivalent of-amd
or--also-make-dependents
- Specified by:
setAlsoMakeDependents
in interfaceInvocationRequest
- Parameters:
alsoMakeDependents
- enable 'also make' mode- Returns:
- This invocation request.
-
getResumeFrom
public java.lang.String getResumeFrom()
Get the value ofresume-from
- Specified by:
getResumeFrom
in interfaceInvocationRequest
- Returns:
- specified reactor project to resume from
-
setResumeFrom
public InvocationRequest setResumeFrom(java.lang.String resumeFrom)
Resume reactor from specified project. Equivalent of-rf
or--resume-from
- Specified by:
setResumeFrom
in interfaceInvocationRequest
- Parameters:
resumeFrom
- set the project to resume from- Returns:
- This invocation request
-
-