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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.maven.shared.invoker.InvocationRequest
InvocationRequest.CheckSumPolicy, InvocationRequest.ReactorFailureBehavior
-
-
Field Summary
-
Fields inherited from interface org.apache.maven.shared.invoker.InvocationRequest
NO_TIMEOUT
-
-
Constructor Summary
Constructors Constructor Description DefaultInvocationRequest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InvocationRequest
addArg(java.lang.String arg)
Add a raw argument to Maven cli command at the end of other arguments.InvocationRequest
addArgs(java.util.Collection<java.lang.String> args)
Add a raw arguments list to Maven cli command at the end of other arguments.InvocationRequest
addShellEnvironment(java.lang.String name, java.lang.String value)
Adds the specified environment variable to the Maven invocation.java.util.List<java.lang.String>
getArgs()
List of raw line arguments which will be passed to cli.java.io.File
getBaseDirectory()
getBaseDirectory.java.io.File
getBaseDirectory(java.io.File defaultDirectory)
Gets the path to the base directory of the POM for the Maven invocation.java.lang.String
getBuilder()
Get the current set builder strategy id equivalent of--builder id
.InvocationOutputHandler
getErrorHandler(InvocationOutputHandler defaultHandler)
Gets the handler used to capture the error output from the Maven build.InvocationRequest.CheckSumPolicy
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.io.File
getGlobalToolchainsFile()
Alternate path for the global toolchains file Note.java.util.List<java.lang.String>
getGoals()
Getter for the fieldgoals
.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()
Getter for the fieldjavaHome
.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.io.File
getMavenExecutable()
Get the customized File of the Maven executable.java.io.File
getMavenHome()
Gets the path to the base directory of the Maven installation used to invoke Maven.java.lang.String
getMavenOpts()
Getter for the fieldmavenOpts
.InvocationOutputHandler
getOutputHandler(InvocationOutputHandler defaultHandler)
Gets the handler used to capture the standard output from the Maven build.java.io.File
getPomFile()
Getter for the fieldpomFile
.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()
Getter for the fieldproperties
.InvocationRequest.ReactorFailureBehavior
getReactorFailureBehavior()
getReactorFailureBehavior.java.lang.String
getResumeFrom()
Get the value ofresume-from
java.util.Map<java.lang.String,java.lang.String>
getShellEnvironments()
Getter for the fieldshellEnvironments
.java.lang.String
getThreads()
Get the value of thethreads
argument.int
getTimeoutInSeconds()
getTimeoutInSeconds.java.io.File
getToolchainsFile()
Gets the path to the custom toolchains fileUpdateSnapshotsPolicy
getUpdateSnapshotsPolicy()
Indicates the update snapshots policy.java.io.File
getUserSettingsFile()
Gets the path to the user settings for the Maven invocation.boolean
isAlsoMake()
Get the value of thealso-make
argument.boolean
isAlsoMakeDependents()
Get the value of thealso-make-dependents
boolean
isBatchMode()
isBatchMode.boolean
isDebug()
isDebug.boolean
isNonPluginUpdates()
Indicates whether Maven should check for plugin updates.boolean
isNoTransferProgress()
Get the value of theno-transfer-progress
argument.boolean
isOffline()
isOffline.boolean
isQuiet()
Gets the quiet mode of the Maven invocation.boolean
isRecursive()
isRecursive.boolean
isShellEnvironmentInherited()
isShellEnvironmentInherited.boolean
isShowErrors()
isShowErrors.boolean
isShowVersion()
isShowVersion.boolean
isUpdateSnapshots()
isUpdateSnapshots.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
setBatchMode(boolean interactive)
Sets the interaction mode of the Maven invocation.InvocationRequest
setBuilder(java.lang.String id)
The id of the build strategy to use.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
setGlobalChecksumPolicy(InvocationRequest.CheckSumPolicy 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
setGlobalToolchainsFile(java.io.File toolchains)
Sets the alternate path for the global toolchains file Equivalent of-gt
or--global-toolchains
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
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
setMavenExecutable(java.io.File mavenExecutable)
mavenExecutable
can either be a file relative to ${maven.home}/bin/ or an absolute file.InvocationRequest
setMavenHome(java.io.File mavenHome)
Sets the path to the base directory of the Maven installation used to invoke Maven.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
setNoTransferProgress(boolean noTransferProgress)
Enable no transfer progress mode.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
setQuiet(boolean quiet)
Sets the quiet mode of the Maven invocation.InvocationRequest
setReactorFailureBehavior(InvocationRequest.ReactorFailureBehavior failureBehavior)
setReactorFailureBehavior.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
void
setTimeoutInSeconds(int timeoutInSeconds)
setTimeoutInSeconds.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
setUpdateSnapshotsPolicy(UpdateSnapshotsPolicy policy)
Specify the Maven update snapshots policyInvocationRequest
setUserSettingsFile(java.io.File userSettings)
Sets the path to the user settings for the Maven invocation.
-
-
-
Method Detail
-
getBaseDirectory
public java.io.File getBaseDirectory()
getBaseDirectory.
- Specified by:
getBaseDirectory
in interfaceInvocationRequest
- Returns:
- a
File
object.
-
getBaseDirectory
public java.io.File getBaseDirectory(java.io.File defaultDirectory)
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)
Gets the handler used to capture the error output from the Maven build.- Specified by:
getErrorHandler
in interfaceInvocationRequest
- Parameters:
defaultHandler
- the defaultInvocationOutputHandler
to use- Returns:
- The error handler or
null
if not set.
-
getReactorFailureBehavior
public InvocationRequest.ReactorFailureBehavior getReactorFailureBehavior()
getReactorFailureBehavior.
- Specified by:
getReactorFailureBehavior
in interfaceInvocationRequest
- Returns:
- a ReactorFailureBehavior object.
-
getGoals
public java.util.List<java.lang.String> getGoals()
Getter for the field
goals
.- Specified by:
getGoals
in interfaceInvocationRequest
- Returns:
- a
List
object.
-
getInputStream
public java.io.InputStream getInputStream(java.io.InputStream defaultStream)
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
- Parameters:
defaultStream
- the defaultInputStream
to use- 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)
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)
Gets the handler used to capture the standard output from the Maven build.- Specified by:
getOutputHandler
in interfaceInvocationRequest
- Parameters:
defaultHandler
- the defaultInvocationOutputHandler
to use- Returns:
- The output handler or
null
if not set.
-
getPomFile
public java.io.File getPomFile()
Getter for the field
pomFile
.- Specified by:
getPomFile
in interfaceInvocationRequest
- Returns:
- a
File
object.
-
getProperties
public java.util.Properties getProperties()
Getter for the field
properties
.- Specified by:
getProperties
in interfaceInvocationRequest
- Returns:
- a
Properties
object.
-
isDebug
public boolean isDebug()
isDebug.
- Specified by:
isDebug
in interfaceInvocationRequest
- Returns:
- a boolean.
-
isBatchMode
public boolean isBatchMode()
isBatchMode.
- Specified by:
isBatchMode
in interfaceInvocationRequest
- Returns:
- a boolean.
-
isOffline
public boolean isOffline()
isOffline.
- Specified by:
isOffline
in interfaceInvocationRequest
- Returns:
- a boolean.
-
isShowErrors
public boolean isShowErrors()
isShowErrors.
- Specified by:
isShowErrors
in interfaceInvocationRequest
- Returns:
- a boolean.
-
isUpdateSnapshots
public boolean isUpdateSnapshots()
isUpdateSnapshots.
- Specified by:
isUpdateSnapshots
in interfaceInvocationRequest
- Returns:
- a boolean.
- See Also:
which provides a richer variety of the update snapshots policy values.
-
getUpdateSnapshotsPolicy
public UpdateSnapshotsPolicy getUpdateSnapshotsPolicy()
Description copied from interface:InvocationRequest
Indicates the update snapshots policy.- Specified by:
getUpdateSnapshotsPolicy
in interfaceInvocationRequest
- Returns:
- the update snapshots policy.
- See Also:
UpdateSnapshotsPolicy
-
isRecursive
public boolean isRecursive()
isRecursive.
- Specified by:
isRecursive
in interfaceInvocationRequest
- Returns:
- a boolean.
-
setRecursive
public InvocationRequest setRecursive(boolean recursive)
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)
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)
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)
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.
-
setReactorFailureBehavior
public InvocationRequest setReactorFailureBehavior(InvocationRequest.ReactorFailureBehavior failureBehavior)
setReactorFailureBehavior.
- Specified by:
setReactorFailureBehavior
in interfaceInvocationRequest
- Parameters:
failureBehavior
- a ReactorFailureBehavior object.- Returns:
- a
InvocationRequest
object.
-
setGoals
public InvocationRequest setGoals(java.util.List<java.lang.String> goals)
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)
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.
-
setBatchMode
public InvocationRequest setBatchMode(boolean interactive)
Sets the interaction mode of the Maven invocation. Equivalent of-B
and--batch-mode
- Specified by:
setBatchMode
in interfaceInvocationRequest
- Parameters:
interactive
-true
if Maven should be executed in non-interactive mode,false
if the interactive modes is used.- Returns:
- This invocation request.
-
setLocalRepositoryDirectory
public InvocationRequest setLocalRepositoryDirectory(java.io.File localRepository)
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)
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)
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)
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)
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)
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)
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 must be updated,false
otherwise.- Returns:
- This invocation request.
- See Also:
which provides a richer variety of the update snapshots policy values.
-
setUpdateSnapshotsPolicy
public InvocationRequest setUpdateSnapshotsPolicy(UpdateSnapshotsPolicy policy)
Description copied from interface:InvocationRequest
Specify the Maven update snapshots policy- Specified by:
setUpdateSnapshotsPolicy
in interfaceInvocationRequest
- Parameters:
policy
- the policy to be set- Returns:
- This invocation request.
- See Also:
UpdateSnapshotsPolicy
-
isShellEnvironmentInherited
public boolean isShellEnvironmentInherited()
isShellEnvironmentInherited.
- Specified by:
isShellEnvironmentInherited
in interfaceInvocationRequest
- Returns:
- a boolean.
- See Also:
MavenCommandLineBuilder.setShellEnvironment(InvocationRequest, Commandline)
-
setShellEnvironmentInherited
public InvocationRequest setShellEnvironmentInherited(boolean shellEnvironmentInherited)
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()
Getter for the field
javaHome
.- Specified by:
getJavaHome
in interfaceInvocationRequest
- Returns:
- a
File
object.
-
setJavaHome
public InvocationRequest setJavaHome(java.io.File javaHome)
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()
Gets the path to the user settings for the Maven invocation.- Specified by:
getUserSettingsFile
in interfaceInvocationRequest
- Returns:
- a
File
object.
-
setUserSettingsFile
public InvocationRequest setUserSettingsFile(java.io.File userSettings)
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()
Gets the path to the global settings for the Maven invocation.- Specified by:
getGlobalSettingsFile
in interfaceInvocationRequest
- Returns:
- a
File
object.
-
setGlobalSettingsFile
public InvocationRequest setGlobalSettingsFile(java.io.File globalSettings)
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()
Gets the path to the custom toolchains file- Specified by:
getToolchainsFile
in interfaceInvocationRequest
- Returns:
- a
File
object.
-
setToolchainsFile
public InvocationRequest setToolchainsFile(java.io.File toolchains)
Sets the alternate path for the user toolchains file Equivalent of-t
or--toolchains
- Specified by:
setToolchainsFile
in interfaceInvocationRequest
- Parameters:
toolchains
- the alternate path for the user toolchains file- Returns:
- This invocation request
-
getGlobalToolchainsFile
public java.io.File getGlobalToolchainsFile()
Alternate path for the global toolchains file Note. This is available since Maven 3.3.1- Specified by:
getGlobalToolchainsFile
in interfaceInvocationRequest
- Returns:
- a
File
object.
-
setGlobalToolchainsFile
public InvocationRequest setGlobalToolchainsFile(java.io.File toolchains)
Sets the alternate path for the global toolchains file Equivalent of-gt
or--global-toolchains
- Specified by:
setGlobalToolchainsFile
in interfaceInvocationRequest
- Parameters:
toolchains
- the alternate path for the global toolchains file- Returns:
- This invocation request
-
getGlobalChecksumPolicy
public InvocationRequest.CheckSumPolicy getGlobalChecksumPolicy()
Gets the checksum mode of the Maven invocation.- Specified by:
getGlobalChecksumPolicy
in interfaceInvocationRequest
- Returns:
- a CheckSumPolicy object.
-
setGlobalChecksumPolicy
public InvocationRequest setGlobalChecksumPolicy(InvocationRequest.CheckSumPolicy globalChecksumPolicy)
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
- a CheckSumPolicy object.- Returns:
- a
InvocationRequest
object.
-
getPomFileName
public java.lang.String getPomFileName()
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:
- a
String
object.
-
addArg
public InvocationRequest addArg(java.lang.String arg)
Description copied from interface:InvocationRequest
Add a raw argument to Maven cli command at the end of other arguments. Can be called multiple time in order to add many arguments.- Specified by:
addArg
in interfaceInvocationRequest
- Parameters:
arg
- a raw Maven arg line- Returns:
- This invocation request.
-
addArgs
public InvocationRequest addArgs(java.util.Collection<java.lang.String> args)
Description copied from interface:InvocationRequest
Add a raw arguments list to Maven cli command at the end of other arguments. Can be called multiple time in order to add many arguments.- Specified by:
addArgs
in interfaceInvocationRequest
- Parameters:
args
- a raw Maven args line- Returns:
- This invocation request.
-
getArgs
public java.util.List<java.lang.String> getArgs()
Description copied from interface:InvocationRequest
List of raw line arguments which will be passed to cli.- Specified by:
getArgs
in interfaceInvocationRequest
- Returns:
- a list of cli arguments
-
setPomFileName
public InvocationRequest setPomFileName(java.lang.String pomFilename)
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()
Gets the profiles for the Maven invocation.- Specified by:
getProfiles
in interfaceInvocationRequest
- Returns:
- a
List
object.
-
setProfiles
public InvocationRequest setProfiles(java.util.List<java.lang.String> profiles)
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()
Indicates whether Maven should check for plugin updates. By default, plugin updates are not suppressed.- Specified by:
isNonPluginUpdates
in interfaceInvocationRequest
- Returns:
- a boolean.
-
setNonPluginUpdates
public InvocationRequest setNonPluginUpdates(boolean nonPluginUpdates)
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)
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()
Getter for the field
shellEnvironments
.- Specified by:
getShellEnvironments
in interfaceInvocationRequest
- Returns:
- a
Map
object.
-
getMavenOpts
public java.lang.String getMavenOpts()
Getter for the field
mavenOpts
.- Specified by:
getMavenOpts
in interfaceInvocationRequest
- Returns:
- a
String
object.
-
setMavenOpts
public InvocationRequest setMavenOpts(java.lang.String mavenOpts)
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.
-
isShowVersion
public boolean isShowVersion()
isShowVersion.
- Specified by:
isShowVersion
in interfaceInvocationRequest
- Returns:
- a boolean.
- See Also:
InvocationRequest.isShowVersion()
-
setShowVersion
public InvocationRequest setShowVersion(boolean showVersion)
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.
-
getThreads
public java.lang.String getThreads()
Get the value of thethreads
argument.- Specified by:
getThreads
in interfaceInvocationRequest
- Returns:
- a
String
object.
-
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:
- a
List
object.
-
setProjects
public InvocationRequest setProjects(java.util.List<java.lang.String> projects)
Sets the reactor project list. Equivalent of-pl
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:
- a boolean.
-
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:
- a boolean.
-
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:
- a
String
object.
-
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
-
setBuilder
public InvocationRequest setBuilder(java.lang.String id)
The id of the build strategy to use. equivalent of-b id
or--builder id
. Note. This is available since Maven 3.2.1- Specified by:
setBuilder
in interfaceInvocationRequest
- Parameters:
id
- The builder id.- Returns:
InvocationRequest
-
getBuilder
public java.lang.String getBuilder()
Get the current set builder strategy id equivalent of--builder id
. Note. This is available since Maven 3.2.1- Specified by:
getBuilder
in interfaceInvocationRequest
- Returns:
- a
String
object.
-
getTimeoutInSeconds
public int getTimeoutInSeconds()
getTimeoutInSeconds.
- Specified by:
getTimeoutInSeconds
in interfaceInvocationRequest
- Returns:
- the timeout in seconds to execute the project
-
setTimeoutInSeconds
public void setTimeoutInSeconds(int timeoutInSeconds)
setTimeoutInSeconds.
- Specified by:
setTimeoutInSeconds
in interfaceInvocationRequest
- Parameters:
timeoutInSeconds
- the timeout in seconds to execute the project
-
isQuiet
public boolean isQuiet()
Gets the quiet mode of the Maven invocation. By default, Maven is executed in normal mode.- Specified by:
isQuiet
in interfaceInvocationRequest
- Returns:
- a boolean.
- Since:
- 3.1.0
-
setQuiet
public InvocationRequest setQuiet(boolean quiet)
Sets the quiet mode of the Maven invocation. Equivalent of-q
and--quiet
- Specified by:
setQuiet
in interfaceInvocationRequest
- Parameters:
quiet
-true
if Maven should be executed in quiet mode,false
if the normal mode should be used.- Returns:
- This invocation request.
-
isNoTransferProgress
public boolean isNoTransferProgress()
Description copied from interface:InvocationRequest
Get the value of theno-transfer-progress
argument.- Specified by:
isNoTransferProgress
in interfaceInvocationRequest
- Returns:
true
if the argumentno-transfer-progress
was specified, otherwisefalse
-
setNoTransferProgress
public InvocationRequest setNoTransferProgress(boolean noTransferProgress)
Description copied from interface:InvocationRequest
Enable no transfer progress mode. Equivalent of-ntp
or--no-transfer-progress
- Specified by:
setNoTransferProgress
in interfaceInvocationRequest
- Parameters:
noTransferProgress
- enable no transfer progress mode- Returns:
- This invocation request.
-
getMavenHome
public java.io.File getMavenHome()
Gets the path to the base directory of the Maven installation used to invoke Maven.- Specified by:
getMavenHome
in interfaceInvocationRequest
- Returns:
- The path to the base directory of the Maven installation or
null
if using the default Maven installation.
-
setMavenHome
public InvocationRequest setMavenHome(java.io.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.home
.- Specified by:
setMavenHome
in interfaceInvocationRequest
- Parameters:
mavenHome
- The path to the base directory of the Maven installation, may benull
to use the default Maven installation.- Returns:
- This invocation request
-
getMavenExecutable
public java.io.File getMavenExecutable()
Get the customized File of the Maven executable.- Specified by:
getMavenExecutable
in interfaceInvocationRequest
- Returns:
- the custom Maven executable, otherwise
null
-
setMavenExecutable
public InvocationRequest setMavenExecutable(java.io.File mavenExecutable)
mavenExecutable
can either be a file relative to ${maven.home}/bin/ or an absolute file.- Specified by:
setMavenExecutable
in interfaceInvocationRequest
- Parameters:
mavenExecutable
- the executable- Returns:
- This invocation request
-
-