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 Modifier and Type Field Description private booleanalsoMakeprivate booleanalsoMakeDependentsprivate java.io.Filebasedirprivate java.lang.StringbuilderIdprivate booleandebugprivate InvocationOutputHandlererrorHandlerprivate InvocationRequest.ReactorFailureBehaviorfailureBehaviorprivate InvocationRequest.CheckSumPolicyglobalChecksumPolicyprivate java.io.FileglobalSettingsprivate java.io.FileglobalToolchainsprivate java.util.List<java.lang.String>goalsprivate java.io.InputStreaminputStreamprivate booleaninteractiveprivate java.io.FilejavaHomeprivate java.io.FilelocalRepositoryprivate java.lang.StringmavenOptsprivate booleannonPluginUpdatesprivate booleanofflineprivate InvocationOutputHandleroutputHandlerprivate java.io.FilepomFileprivate java.lang.StringpomFilenameprivate java.util.List<java.lang.String>profilesprivate java.util.List<java.lang.String>projectsprivate java.util.Propertiespropertiesprivate booleanrecursiveprivate java.lang.StringresumeFromprivate booleanshellEnvironmentInheritedprivate java.util.Map<java.lang.String,java.lang.String>shellEnvironmentsprivate booleanshowErrorsprivate booleanshowVersionprivate java.lang.Stringthreadsprivate inttimeoutInSecondsprivate java.io.Filetoolchainsprivate booleanupdateSnapshotsprivate java.io.FileuserSettings-
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 InvocationRequestaddShellEnvironment(java.lang.String name, java.lang.String value)Adds the specified environment variable to the Maven invocation.java.io.FilegetBaseDirectory()Gets the path to the base directory of the POM for the Maven invocation.java.io.FilegetBaseDirectory(java.io.File defaultDirectory)Gets the path to the base directory of the POM for the Maven invocation.java.lang.StringgetBuilder()Get the current set builder strategy id equivalent of--builder id.InvocationOutputHandlergetErrorHandler(InvocationOutputHandler defaultHandler)Gets the handler used to capture the error output from the Maven build.InvocationRequest.CheckSumPolicygetGlobalChecksumPolicy()Gets the checksum mode of the Maven invocation.java.io.FilegetGlobalSettingsFile()Gets the path to the global settings for the Maven invocation.java.io.FilegetGlobalToolchainsFile()Alternate path for the global toolchains file Note.java.util.List<java.lang.String>getGoals()Gets the goals for the Maven invocation.java.io.InputStreamgetInputStream(java.io.InputStream defaultStream)Gets the input stream used to provide input for the invoked Maven build.java.io.FilegetJavaHome()Gets the path to the base directory of the Java installation used to run Maven.java.io.FilegetLocalRepositoryDirectory(java.io.File defaultDirectory)Gets the path to the base directory of the local repository to use for the Maven invocation.java.lang.StringgetMavenOpts()Gets the value of theMAVEN_OPTSenvironment variable.InvocationOutputHandlergetOutputHandler(InvocationOutputHandler defaultHandler)Gets the handler used to capture the standard output from the Maven build.java.io.FilegetPomFile()Gets the path to the POM for the Maven invocation.java.lang.StringgetPomFileName()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.PropertiesgetProperties()Gets the system properties for the Maven invocation.InvocationRequest.ReactorFailureBehaviorgetReactorFailureBehavior()Gets the failure mode of the Maven invocation.java.lang.StringgetResumeFrom()Get the value ofresume-fromjava.util.Map<java.lang.String,java.lang.String>getShellEnvironments()Gets the environment variables for the Maven invocation.java.lang.StringgetThreads()Get the value of thethreadsargument.intgetTimeoutInSeconds()java.io.FilegetToolchainsFile()Gets the path to the custom toolchains filejava.io.FilegetUserSettingsFile()Gets the path to the user settings for the Maven invocation.booleanisAlsoMake()Get the value of thealso-makeargument.booleanisAlsoMakeDependents()Get the value of thealso-make-dependentsbooleanisBatchMode()By default, Maven is executed in batch mode.booleanisDebug()Gets the debug mode of the Maven invocation.booleanisNonPluginUpdates()Indicates whether Maven should check for plugin updates.booleanisOffline()Gets the network mode of the Maven invocation.booleanisRecursive()Gets the recursion behavior of a reactor invocation.booleanisShellEnvironmentInherited()Indicates whether the environment variables of the current process should be propagated to the Maven invocation.booleanisShowErrors()Gets the exception output mode of the Maven invocation.booleanisShowVersion()The show version behavior (-V option)booleanisUpdateSnapshots()Indicates whether Maven should enforce an update check for plugins and snapshots.InvocationRequestsetAlsoMake(boolean alsoMake)Enable the 'also make' mode.InvocationRequestsetAlsoMakeDependents(boolean alsoMakeDependents)Enable the 'also make dependents' mode.InvocationRequestsetBaseDirectory(java.io.File basedir)Sets the path to the base directory of the POM for the Maven invocation.InvocationRequestsetBatchMode(boolean interactive)Sets the interaction mode of the Maven invocation.InvocationRequestsetBuilder(java.lang.String id)The id of the build strategy to use.InvocationRequestsetDebug(boolean debug)Sets the debug mode of the Maven invocation.InvocationRequestsetErrorHandler(InvocationOutputHandler errorHandler)Sets the handler used to capture the error output from the Maven build.InvocationRequestsetGlobalChecksumPolicy(InvocationRequest.CheckSumPolicy globalChecksumPolicy)Sets the checksum mode of the Maven invocation.InvocationRequestsetGlobalSettingsFile(java.io.File globalSettings)Sets the path to the global settings for the Maven invocation.InvocationRequestsetGlobalToolchainsFile(java.io.File toolchains)Sets the alternate path for the global toolchains file Equivalent of-gtor--global-toolchainsInvocationRequestsetGoals(java.util.List<java.lang.String> goals)Sets the goals for the Maven invocation.InvocationRequestsetInputStream(java.io.InputStream inputStream)Sets the input stream used to provide input for the invoked Maven build.InvocationRequestsetJavaHome(java.io.File javaHome)Sets the path to the base directory of the Java installation used to run Maven.InvocationRequestsetLocalRepositoryDirectory(java.io.File localRepository)Sets the path to the base directory of the local repository to use for the Maven invocation.InvocationRequestsetMavenOpts(java.lang.String mavenOpts)Sets the value of theMAVEN_OPTSenvironment variable.InvocationRequestsetNonPluginUpdates(boolean nonPluginUpdates)Specifies whether Maven should check for plugin updates.InvocationRequestsetOffline(boolean offline)Sets the network mode of the Maven invocation.InvocationRequestsetOutputHandler(InvocationOutputHandler outputHandler)Sets the handler used to capture the standard output from the Maven build.InvocationRequestsetPomFile(java.io.File pomFile)Sets the path to the POM for the Maven invocation.InvocationRequestsetPomFileName(java.lang.String pomFilename)Sets the (unqualified) filename of the POM for the Maven invocation.InvocationRequestsetProfiles(java.util.List<java.lang.String> profiles)Sets the profiles for the Maven invocation.InvocationRequestsetProjects(java.util.List<java.lang.String> projects)Sets the reactor project list.InvocationRequestsetProperties(java.util.Properties properties)Sets the system properties for the Maven invocation.InvocationRequestsetReactorFailureBehavior(InvocationRequest.ReactorFailureBehavior failureBehavior)Sets the failure mode of the Maven invocation.InvocationRequestsetRecursive(boolean recursive)Sets the recursion behavior of a reactor invocation.InvocationRequestsetResumeFrom(java.lang.String resumeFrom)Resume reactor from specified project.InvocationRequestsetShellEnvironmentInherited(boolean shellEnvironmentInherited)Specifies whether the environment variables of the current process should be propagated to the Maven invocation.InvocationRequestsetShowErrors(boolean showErrors)Sets the exception output mode of the Maven invocation.InvocationRequestsetShowVersion(boolean showVersion)enable displaying version without stopping the build Equivalent of-Vor--show-versionInvocationRequestsetThreads(java.lang.String threads)Thread count, for instance 2.0C where C is core multiplied Equivalent of-Tor--threadsvoidsetTimeoutInSeconds(int timeoutInSeconds)InvocationRequestsetToolchainsFile(java.io.File toolchains)Sets the alternate path for the user toolchains file Equivalent of-tor--toolchainsInvocationRequestsetUpdateSnapshots(boolean updateSnapshots)Specifies whether Maven should enforce an update check for plugins and snapshots.InvocationRequestsetUserSettingsFile(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 InvocationRequest.ReactorFailureBehavior 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
-
globalToolchains
private java.io.File globalToolchains
-
globalChecksumPolicy
private InvocationRequest.CheckSumPolicy 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
-
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
-
builderId
private java.lang.String builderId
-
timeoutInSeconds
private int timeoutInSeconds
-
-
Method Detail
-
getBaseDirectory
public java.io.File getBaseDirectory()
Description copied from interface:InvocationRequestGets 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:
getBaseDirectoryin interfaceInvocationRequest- Returns:
- The path to the base directory of the POM or
nullif not set.
-
getBaseDirectory
public java.io.File getBaseDirectory(java.io.File defaultDirectory)
Description copied from interface:InvocationRequestGets 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:
getBaseDirectoryin 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
nullif not set.
-
getErrorHandler
public InvocationOutputHandler getErrorHandler(InvocationOutputHandler defaultHandler)
Description copied from interface:InvocationRequestGets the handler used to capture the error output from the Maven build.- Specified by:
getErrorHandlerin interfaceInvocationRequest- Parameters:
defaultHandler- the defaultInvocationOutputHandlerto use- Returns:
- The error handler or
nullif not set.
-
getReactorFailureBehavior
public InvocationRequest.ReactorFailureBehavior getReactorFailureBehavior()
Description copied from interface:InvocationRequestGets the failure mode of the Maven invocation. By default, the modeInvocationRequest.ReactorFailureBehavior.FailFastis used.- Specified by:
getReactorFailureBehaviorin interfaceInvocationRequest- Returns:
- The failure mode, one of
InvocationRequest.ReactorFailureBehavior.FailFast,InvocationRequest.ReactorFailureBehavior.FailAtEndandInvocationRequest.ReactorFailureBehavior.FailNever.
-
getGoals
public java.util.List<java.lang.String> getGoals()
Description copied from interface:InvocationRequestGets the goals for the Maven invocation.- Specified by:
getGoalsin interfaceInvocationRequest- Returns:
- The goals for the Maven invocation or
nullif not set.
-
getInputStream
public java.io.InputStream getInputStream(java.io.InputStream defaultStream)
Description copied from interface:InvocationRequestGets 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:
getInputStreamin interfaceInvocationRequest- Parameters:
defaultStream- the defaultInputStreamto use- Returns:
- The input stream used to provide input for the invoked Maven build or
nullif not set.
-
getLocalRepositoryDirectory
public java.io.File getLocalRepositoryDirectory(java.io.File defaultDirectory)
Description copied from interface:InvocationRequestGets the path to the base directory of the local repository to use for the Maven invocation.- Specified by:
getLocalRepositoryDirectoryin 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
nullto use the location from thesettings.xml.
-
getOutputHandler
public InvocationOutputHandler getOutputHandler(InvocationOutputHandler defaultHandler)
Description copied from interface:InvocationRequestGets the handler used to capture the standard output from the Maven build.- Specified by:
getOutputHandlerin interfaceInvocationRequest- Parameters:
defaultHandler- the defaultInvocationOutputHandlerto use- Returns:
- The output handler or
nullif not set.
-
getPomFile
public java.io.File getPomFile()
Description copied from interface:InvocationRequestGets 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:
getPomFilein interfaceInvocationRequest- Returns:
- The path to the POM for the Maven invocation or
nullif not set.
-
getProperties
public java.util.Properties getProperties()
Description copied from interface:InvocationRequestGets the system properties for the Maven invocation.- Specified by:
getPropertiesin interfaceInvocationRequest- Returns:
- The system properties for the Maven invocation or
nullif not set.
-
isDebug
public boolean isDebug()
Description copied from interface:InvocationRequestGets the debug mode of the Maven invocation. By default, Maven is executed in normal mode.- Specified by:
isDebugin interfaceInvocationRequest- Returns:
trueif Maven should be executed in debug mode,falseif the normal mode should be used.
-
isBatchMode
public boolean isBatchMode()
Description copied from interface:InvocationRequestBy default, Maven is executed in batch mode. This mean no interaction with the Maven process can be done.- Specified by:
isBatchModein interfaceInvocationRequest- Returns:
trueif Maven should be executed in batch mode,falseif Maven is executed in interactive mode.
-
isOffline
public boolean isOffline()
Description copied from interface:InvocationRequestGets the network mode of the Maven invocation. By default, Maven is executed in online mode.- Specified by:
isOfflinein interfaceInvocationRequest- Returns:
trueif Maven should be executed in offline mode,falseif the online mode is used.
-
isShowErrors
public boolean isShowErrors()
Description copied from interface:InvocationRequestGets the exception output mode of the Maven invocation. By default, Maven will not print stack traces of build exceptions.- Specified by:
isShowErrorsin interfaceInvocationRequest- Returns:
trueif Maven should print stack traces,falseotherwise.
-
isUpdateSnapshots
public boolean isUpdateSnapshots()
Description copied from interface:InvocationRequestIndicates whether Maven should enforce an update check for plugins and snapshots. By default, no update check is performed.- Specified by:
isUpdateSnapshotsin interfaceInvocationRequest- Returns:
trueif plugins and snapshots should be updated,falseotherwise.
-
isRecursive
public boolean isRecursive()
Description copied from interface:InvocationRequestGets the recursion behavior of a reactor invocation. By default, Maven will recursive the build into sub modules.- Specified by:
isRecursivein interfaceInvocationRequest- Returns:
trueif sub modules should be build,falseotherwise.
-
setRecursive
public InvocationRequest setRecursive(boolean recursive)
Description copied from interface:InvocationRequestSets the recursion behavior of a reactor invocation. Inverse equivalent of-Nand--non-recursive- Specified by:
setRecursivein interfaceInvocationRequest- Parameters:
recursive-trueif sub modules should be build,falseotherwise.- Returns:
- This invocation request.
-
setBaseDirectory
public InvocationRequest setBaseDirectory(java.io.File basedir)
Description copied from interface:InvocationRequestSets 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:
setBaseDirectoryin interfaceInvocationRequest- Parameters:
basedir- The path to the base directory of the POM, may benullif not used.- Returns:
- This invocation request.
-
setDebug
public InvocationRequest setDebug(boolean debug)
Description copied from interface:InvocationRequestSets the debug mode of the Maven invocation. Equivalent of-Xand--debug- Specified by:
setDebugin interfaceInvocationRequest- Parameters:
debug-trueif Maven should be executed in debug mode,falseif the normal mode should be used.- Returns:
- This invocation request.
-
setErrorHandler
public InvocationRequest setErrorHandler(InvocationOutputHandler errorHandler)
Description copied from interface:InvocationRequestSets the handler used to capture the error output from the Maven build.- Specified by:
setErrorHandlerin interfaceInvocationRequest- Parameters:
errorHandler- The error handler, may benullif the output is not of interest.- Returns:
- This invocation request.
-
setReactorFailureBehavior
public InvocationRequest setReactorFailureBehavior(InvocationRequest.ReactorFailureBehavior failureBehavior)
Description copied from interface:InvocationRequestSets the failure mode of the Maven invocation. Equivalent of-ffand--fail-fast,-faeand--fail-at-end,-fnand--fail-never- Specified by:
setReactorFailureBehaviorin interfaceInvocationRequest- Parameters:
failureBehavior- The failure mode, must be one ofInvocationRequest.ReactorFailureBehavior.FailFast,InvocationRequest.ReactorFailureBehavior.FailAtEndandInvocationRequest.ReactorFailureBehavior.FailNever.- Returns:
- This invocation request.
-
setGoals
public InvocationRequest setGoals(java.util.List<java.lang.String> goals)
Description copied from interface:InvocationRequestSets the goals for the Maven invocation.- Specified by:
setGoalsin interfaceInvocationRequest- Parameters:
goals- The goals for the Maven invocation, may benullto execute the POMs default goal.- Returns:
- This invocation request.
-
setInputStream
public InvocationRequest setInputStream(java.io.InputStream inputStream)
Description copied from interface:InvocationRequestSets 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:
setInputStreamin interfaceInvocationRequest- Parameters:
inputStream- The input stream used to provide input for the invoked Maven build, may benullif not required.- Returns:
- This invocation request.
-
setBatchMode
public InvocationRequest setBatchMode(boolean interactive)
Description copied from interface:InvocationRequestSets the interaction mode of the Maven invocation. Equivalent of-Band--batch-mode- Specified by:
setBatchModein interfaceInvocationRequest- Parameters:
interactive-trueif Maven should be executed in non-interactive mode,falseif the interactive modes is used.- Returns:
- This invocation request.
-
setLocalRepositoryDirectory
public InvocationRequest setLocalRepositoryDirectory(java.io.File localRepository)
Description copied from interface:InvocationRequestSets the path to the base directory of the local repository to use for the Maven invocation.- Specified by:
setLocalRepositoryDirectoryin 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:InvocationRequestSets the network mode of the Maven invocation. Equivalent of-oand--offline- Specified by:
setOfflinein interfaceInvocationRequest- Parameters:
offline-trueif Maven should be executed in offline mode,falseif the online mode is used.- Returns:
- This invocation request.
-
setOutputHandler
public InvocationRequest setOutputHandler(InvocationOutputHandler outputHandler)
Description copied from interface:InvocationRequestSets the handler used to capture the standard output from the Maven build.- Specified by:
setOutputHandlerin interfaceInvocationRequest- Parameters:
outputHandler- The output handler, may benullif the output is not of interest.- Returns:
- This invocation request.
-
setPomFile
public InvocationRequest setPomFile(java.io.File pomFile)
Description copied from interface:InvocationRequestSets 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:
setPomFilein interfaceInvocationRequest- Parameters:
pomFile- The path to the POM for the Maven invocation, may benullif not used.- Returns:
- This invocation request.
-
setProperties
public InvocationRequest setProperties(java.util.Properties properties)
Description copied from interface:InvocationRequestSets the system properties for the Maven invocation.- Specified by:
setPropertiesin interfaceInvocationRequest- Parameters:
properties- The system properties for the Maven invocation, may benullif not set.- Returns:
- This invocation request.
-
setShowErrors
public InvocationRequest setShowErrors(boolean showErrors)
Description copied from interface:InvocationRequestSets the exception output mode of the Maven invocation. Equivalent of-eand--errors- Specified by:
setShowErrorsin interfaceInvocationRequest- Parameters:
showErrors-trueif Maven should print stack traces,falseotherwise.- Returns:
- This invocation request.
-
setUpdateSnapshots
public InvocationRequest setUpdateSnapshots(boolean updateSnapshots)
Description copied from interface:InvocationRequestSpecifies whether Maven should enforce an update check for plugins and snapshots. Equivalent of-Uand--update-snapshots- Specified by:
setUpdateSnapshotsin interfaceInvocationRequest- Parameters:
updateSnapshots-trueif plugins and snapshots should be updated,falseotherwise.- Returns:
- This invocation request.
-
isShellEnvironmentInherited
public boolean isShellEnvironmentInherited()
Description copied from interface:InvocationRequestIndicates 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:
isShellEnvironmentInheritedin interfaceInvocationRequest- Returns:
trueif the environment variables should be propagated,falseotherwise.- See Also:
MavenCommandLineBuilder.setShellEnvironment(InvocationRequest, Commandline)
-
setShellEnvironmentInherited
public InvocationRequest setShellEnvironmentInherited(boolean shellEnvironmentInherited)
Description copied from interface:InvocationRequestSpecifies whether the environment variables of the current process should be propagated to the Maven invocation.- Specified by:
setShellEnvironmentInheritedin interfaceInvocationRequest- Parameters:
shellEnvironmentInherited-trueif the environment variables should be propagated,falseotherwise.- Returns:
- This invocation request.
-
getJavaHome
public java.io.File getJavaHome()
Description copied from interface:InvocationRequestGets the path to the base directory of the Java installation used to run Maven.- Specified by:
getJavaHomein interfaceInvocationRequest- Returns:
- The path to the base directory of the Java installation used to run Maven or
nullto use the default Java home.
-
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:
setJavaHomein interfaceInvocationRequest- Parameters:
javaHome- The path to the base directory of the Java installation used to run Maven, may benullto 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:
getUserSettingsFilein interfaceInvocationRequest- Returns:
- The path to the user settings for the Maven invocation or
nullto load the user settings from the default location.
-
setUserSettingsFile
public InvocationRequest setUserSettingsFile(java.io.File userSettings)
Sets the path to the user settings for the Maven invocation. Equivalent of-sand--settings- Specified by:
setUserSettingsFilein interfaceInvocationRequest- Parameters:
userSettings- The path to the user settings for the Maven invocation, may benullto 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:
getGlobalSettingsFilein interfaceInvocationRequest- Returns:
- The path to the global settings for the Maven invocation or
nullto load the global settings from the default location.
-
setGlobalSettingsFile
public InvocationRequest setGlobalSettingsFile(java.io.File globalSettings)
Sets the path to the global settings for the Maven invocation. Equivalent of-gsand--global-settings- Specified by:
setGlobalSettingsFilein interfaceInvocationRequest- Parameters:
globalSettings- The path to the global settings for the Maven invocation, may benullto 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:
getToolchainsFilein interfaceInvocationRequest- Returns:
- The path to the custom toolchains file or
nullto load the toolchains from the default location
-
setToolchainsFile
public InvocationRequest setToolchainsFile(java.io.File toolchains)
Sets the alternate path for the user toolchains file Equivalent of-tor--toolchains- Specified by:
setToolchainsFilein 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:
getGlobalToolchainsFilein interfaceInvocationRequest- Returns:
- The path to the custom global toolchains file or
nullto load the global toolchains from the default location.
-
setGlobalToolchainsFile
public InvocationRequest setGlobalToolchainsFile(java.io.File toolchains)
Sets the alternate path for the global toolchains file Equivalent of-gtor--global-toolchains- Specified by:
setGlobalToolchainsFilein 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:
getGlobalChecksumPolicyin interfaceInvocationRequest- Returns:
- The checksum mode, one of
InvocationRequest.CheckSumPolicy.WarnandInvocationRequest.CheckSumPolicy.Fail.
-
setGlobalChecksumPolicy
public InvocationRequest setGlobalChecksumPolicy(InvocationRequest.CheckSumPolicy globalChecksumPolicy)
Sets the checksum mode of the Maven invocation. Equivalent of-cor--lax-checksums,-Cor--strict-checksums- Specified by:
setGlobalChecksumPolicyin interfaceInvocationRequest- Parameters:
globalChecksumPolicy- The checksum mode, must be one ofInvocationRequest.CheckSumPolicy.WarnandInvocationRequest.CheckSumPolicy.Fail.- Returns:
- This invocation request.
-
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.xmlis used.- Specified by:
getPomFileNamein interfaceInvocationRequest- Returns:
- The (unqualified) filename of the POM for the Maven invocation or
nullif not set.
-
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:
setPomFileNamein interfaceInvocationRequest- Parameters:
pomFilename- The (unqualified) filename of the POM for the Maven invocation, may benullif not used.- Returns:
- This invocation request.
-
getProfiles
public java.util.List<java.lang.String> getProfiles()
Gets the profiles for the Maven invocation.- Specified by:
getProfilesin interfaceInvocationRequest- Returns:
- The profiles for the Maven invocation or
nullif not set.
-
setProfiles
public InvocationRequest setProfiles(java.util.List<java.lang.String> profiles)
Sets the profiles for the Maven invocation. Equivalent of-Pand--active-profiles- Specified by:
setProfilesin interfaceInvocationRequest- Parameters:
profiles- The profiles for the Maven invocation, may benullto 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:
isNonPluginUpdatesin interfaceInvocationRequest- Returns:
trueif plugin updates should be suppressed,falseotherwise.
-
setNonPluginUpdates
public InvocationRequest setNonPluginUpdates(boolean nonPluginUpdates)
Specifies whether Maven should check for plugin updates.Equivalent of
-npuor--no-plugin-updatesnote: Ineffective with Maven3, only kept for backward compatibility
- Specified by:
setNonPluginUpdatesin interfaceInvocationRequest- Parameters:
nonPluginUpdates-trueif plugin updates should be suppressed,falseotherwise.- Returns:
- This invocation request.
-
addShellEnvironment
public InvocationRequest addShellEnvironment(java.lang.String name, java.lang.String value)
Description copied from interface:InvocationRequestAdds the specified environment variable to the Maven invocation.- Specified by:
addShellEnvironmentin 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:InvocationRequestGets the environment variables for the Maven invocation.- Specified by:
getShellEnvironmentsin interfaceInvocationRequest- Returns:
- The environment variables for the Maven invocation or
nullif not set.
-
getMavenOpts
public java.lang.String getMavenOpts()
Description copied from interface:InvocationRequestGets the value of theMAVEN_OPTSenvironment variable.- Specified by:
getMavenOptsin interfaceInvocationRequest- Returns:
- The value of the
MAVEN_OPTSenvironment variable ornullif not set.
-
setMavenOpts
public InvocationRequest setMavenOpts(java.lang.String mavenOpts)
Description copied from interface:InvocationRequestSets the value of theMAVEN_OPTSenvironment variable.- Specified by:
setMavenOptsin interfaceInvocationRequest- Parameters:
mavenOpts- The value of theMAVEN_OPTSenvironment variable, may benullto use the default options.- Returns:
- This invocation request.
-
isShowVersion
public boolean isShowVersion()
Description copied from interface:InvocationRequestThe show version behavior (-V option)- Specified by:
isShowVersionin interfaceInvocationRequest- Returns:
- The show version behavior
- See Also:
InvocationRequest.isShowVersion()
-
setShowVersion
public InvocationRequest setShowVersion(boolean showVersion)
Description copied from interface:InvocationRequestenable displaying version without stopping the build Equivalent of-Vor--show-version- Specified by:
setShowVersionin 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 thethreadsargument.- Specified by:
getThreadsin interfaceInvocationRequest- Returns:
- the value of the
threadsargument ornullif not set
-
setThreads
public InvocationRequest setThreads(java.lang.String threads)
Thread count, for instance 2.0C where C is core multiplied Equivalent of-Tor--threadsnote: available since Maven3
- Specified by:
setThreadsin 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:
getProjectsin 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-plor--projects- Specified by:
setProjectsin interfaceInvocationRequest- Parameters:
projects- the reactor project list- Returns:
- This invocation request.
-
isAlsoMake
public boolean isAlsoMake()
Get the value of thealso-makeargument.- Specified by:
isAlsoMakein interfaceInvocationRequest- Returns:
trueif the argumentalso-makewas specified, otherwisefalse
-
setAlsoMake
public InvocationRequest setAlsoMake(boolean alsoMake)
Enable the 'also make' mode. Equivalent of-amor--also-make- Specified by:
setAlsoMakein interfaceInvocationRequest- Parameters:
alsoMake- enable 'also make' mode- Returns:
- This invocation request.
-
isAlsoMakeDependents
public boolean isAlsoMakeDependents()
Get the value of thealso-make-dependents- Specified by:
isAlsoMakeDependentsin interfaceInvocationRequest- Returns:
trueif the argumentalso-make-dependentswas specified, otherwisefalse
-
setAlsoMakeDependents
public InvocationRequest setAlsoMakeDependents(boolean alsoMakeDependents)
Enable the 'also make dependents' mode. Equivalent of-amdor--also-make-dependents- Specified by:
setAlsoMakeDependentsin interfaceInvocationRequest- Parameters:
alsoMakeDependents- enable 'also make' mode- Returns:
- This invocation request.
-
getResumeFrom
public java.lang.String getResumeFrom()
Get the value ofresume-from- Specified by:
getResumeFromin interfaceInvocationRequest- Returns:
- specified reactor project to resume from
-
setResumeFrom
public InvocationRequest setResumeFrom(java.lang.String resumeFrom)
Resume reactor from specified project. Equivalent of-rfor--resume-from- Specified by:
setResumeFromin 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--builder id. Note. This is available since Maven 3.2.1- Specified by:
setBuilderin interfaceInvocationRequest- Parameters:
id- The builder id.- Returns:
InvocationRequestFIXME: How to identify if this is a valid command line option?
-
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:
getBuilderin interfaceInvocationRequest- Returns:
- The current set builder id.
-
getTimeoutInSeconds
public int getTimeoutInSeconds()
- Specified by:
getTimeoutInSecondsin interfaceInvocationRequest- Returns:
- the timeout in seconds to execute the project
-
setTimeoutInSeconds
public void setTimeoutInSeconds(int timeoutInSeconds)
- Specified by:
setTimeoutInSecondsin interfaceInvocationRequest- Parameters:
timeoutInSeconds- the timeout in seconds to execute the project
-
-