public class DefaultInvocationRequest extends Object implements InvocationRequest
InvocationRequest.CheckSumPolicy, InvocationRequest.ReactorFailureBehaviorNO_TIMEOUT| Constructor and Description |
|---|
DefaultInvocationRequest() |
| Modifier and Type | Method and Description |
|---|---|
InvocationRequest |
addArg(String arg)
Add a raw argument to Maven cli command at the end of other arguments.
|
InvocationRequest |
addShellEnvironment(String name,
String value)
Adds the specified environment variable to the Maven invocation.
|
List<String> |
getArgs()
List of raw line arguments which will be passed to cli.
|
File |
getBaseDirectory()
getBaseDirectory.
|
File |
getBaseDirectory(File defaultDirectory)
Gets the path to the base directory of the POM for the Maven invocation.
|
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.
|
File |
getGlobalSettingsFile()
Gets the path to the global settings for the Maven invocation.
|
File |
getGlobalToolchainsFile()
Alternate path for the global toolchains file Note.
|
List<String> |
getGoals()
Getter for the field
goals. |
InputStream |
getInputStream(InputStream defaultStream)
Gets the input stream used to provide input for the invoked Maven build.
|
File |
getJavaHome()
Getter for the field
javaHome. |
File |
getLocalRepositoryDirectory(File defaultDirectory)
Gets the path to the base directory of the local repository to use for the Maven invocation.
|
File |
getMavenExecutable()
Get the customized File of the Maven executable.
|
File |
getMavenHome()
Gets the path to the base directory of the Maven installation used to invoke Maven.
|
String |
getMavenOpts()
Getter for the field
mavenOpts. |
InvocationOutputHandler |
getOutputHandler(InvocationOutputHandler defaultHandler)
Gets the handler used to capture the standard output from the Maven build.
|
File |
getPomFile()
Getter for the field
pomFile. |
String |
getPomFileName()
Gets the (unqualified) filename of the POM for the Maven invocation.
|
List<String> |
getProfiles()
Gets the profiles for the Maven invocation.
|
List<String> |
getProjects()
A list of specified reactor projects to build instead of all projects.
|
Properties |
getProperties()
Getter for the field
properties. |
InvocationRequest.ReactorFailureBehavior |
getReactorFailureBehavior()
getReactorFailureBehavior.
|
String |
getResumeFrom()
Get the value of
resume-from |
Map<String,String> |
getShellEnvironments()
Getter for the field
shellEnvironments. |
String |
getThreads()
Get the value of the
threads argument. |
int |
getTimeoutInSeconds()
getTimeoutInSeconds.
|
File |
getToolchainsFile()
Gets the path to the custom toolchains file
|
File |
getUserSettingsFile()
Gets the path to the user settings for the Maven invocation.
|
boolean |
isAlsoMake()
Get the value of the
also-make argument. |
boolean |
isAlsoMakeDependents()
Get the value of the
also-make-dependents |
boolean |
isBatchMode()
isBatchMode.
|
boolean |
isDebug()
isDebug.
|
boolean |
isNonPluginUpdates()
Indicates whether Maven should check for plugin updates.
|
boolean |
isNoTransferProgress()
Get the value of the
no-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(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(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(File globalSettings)
Sets the path to the global settings for the Maven invocation.
|
InvocationRequest |
setGlobalToolchainsFile(File toolchains)
Sets the alternate path for the global toolchains file Equivalent of
-gt or --global-toolchains |
InvocationRequest |
setGoals(List<String> goals)
Sets the goals for the Maven invocation.
|
InvocationRequest |
setInputStream(InputStream inputStream)
Sets the input stream used to provide input for the invoked Maven build.
|
InvocationRequest |
setJavaHome(File javaHome)
Sets the path to the base directory of the Java installation used to run Maven.
|
InvocationRequest |
setLocalRepositoryDirectory(File localRepository)
Sets the path to the base directory of the local repository to use for the Maven invocation.
|
InvocationRequest |
setMavenExecutable(File mavenExecutable)
mavenExecutable can either be a file relative to ${maven.home}/bin/ or an absolute file. |
InvocationRequest |
setMavenHome(File mavenHome)
Sets the path to the base directory of the Maven installation used to invoke Maven.
|
InvocationRequest |
setMavenOpts(String mavenOpts)
Sets the value of the
MAVEN_OPTS environment variable. |
InvocationRequest |
setNonPluginUpdates(boolean nonPluginUpdates)
Specifies whether Maven should check for plugin updates.
|
InvocationRequest |
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(File pomFile)
Sets the path to the POM for the Maven invocation.
|
InvocationRequest |
setPomFileName(String pomFilename)
Sets the (unqualified) filename of the POM for the Maven invocation.
|
InvocationRequest |
setProfiles(List<String> profiles)
Sets the profiles for the Maven invocation.
|
InvocationRequest |
setProjects(List<String> projects)
Sets the reactor project list.
|
InvocationRequest |
setProperties(Properties properties)
Sets the system properties for the Maven invocation.
|
InvocationRequest |
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(String resumeFrom)
Resume reactor from specified project.
|
InvocationRequest |
setShellEnvironmentInherited(boolean shellEnvironmentInherited)
Specifies whether the environment variables of the current process should be propagated to the Maven invocation.
|
InvocationRequest |
setShowErrors(boolean showErrors)
Sets the exception output mode of the Maven invocation.
|
InvocationRequest |
setShowVersion(boolean showVersion)
enable displaying version without stopping the build Equivalent of
-V or --show-version |
InvocationRequest |
setThreads(String threads)
Thread count, for instance 2.0C where C is core multiplied Equivalent of
-T or --threads |
void |
setTimeoutInSeconds(int timeoutInSeconds)
setTimeoutInSeconds.
|
InvocationRequest |
setToolchainsFile(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(File userSettings)
Sets the path to the user settings for the Maven invocation.
|
public File getBaseDirectory()
getBaseDirectory.
getBaseDirectory in interface InvocationRequestFile object.public File getBaseDirectory(File defaultDirectory)
InvocationRequest.getPomFile() does not return
null, this setting only affects the working directory for the Maven invocation.getBaseDirectory in interface InvocationRequestdefaultDirectory - The default base directory to use if none is configured for this request, may be
null.null if not set.public InvocationOutputHandler getErrorHandler(InvocationOutputHandler defaultHandler)
getErrorHandler in interface InvocationRequestdefaultHandler - the default InvocationOutputHandler to usenull if not set.public InvocationRequest.ReactorFailureBehavior getReactorFailureBehavior()
getReactorFailureBehavior.
getReactorFailureBehavior in interface InvocationRequestpublic List<String> getGoals()
Getter for the field goals.
getGoals in interface InvocationRequestList object.public InputStream getInputStream(InputStream defaultStream)
getInputStream in interface InvocationRequestdefaultStream - the default InputStream to usenull if not set.public File getLocalRepositoryDirectory(File defaultDirectory)
getLocalRepositoryDirectory in interface InvocationRequestdefaultDirectory - The default location to use if no location is configured for this request, may be
null.null to use the location from the
settings.xml.public InvocationOutputHandler getOutputHandler(InvocationOutputHandler defaultHandler)
getOutputHandler in interface InvocationRequestdefaultHandler - the default InvocationOutputHandler to usenull if not set.public File getPomFile()
Getter for the field pomFile.
getPomFile in interface InvocationRequestFile object.public Properties getProperties()
Getter for the field properties.
getProperties in interface InvocationRequestProperties object.public boolean isDebug()
isDebug.
isDebug in interface InvocationRequestpublic boolean isBatchMode()
isBatchMode.
isBatchMode in interface InvocationRequestpublic boolean isOffline()
isOffline.
isOffline in interface InvocationRequestpublic boolean isShowErrors()
isShowErrors.
isShowErrors in interface InvocationRequestpublic boolean isUpdateSnapshots()
isUpdateSnapshots.
isUpdateSnapshots in interface InvocationRequestpublic boolean isRecursive()
isRecursive.
isRecursive in interface InvocationRequestpublic InvocationRequest setRecursive(boolean recursive)
-N and
--non-recursivesetRecursive in interface InvocationRequestrecursive - true if sub modules should be build, false otherwise.public InvocationRequest setBaseDirectory(File basedir)
InvocationRequest.getPomFile() does not return
null, this setting only affects the working directory for the Maven invocation.setBaseDirectory in interface InvocationRequestbasedir - The path to the base directory of the POM, may be null if not used.public InvocationRequest setDebug(boolean debug)
-X and --debugsetDebug in interface InvocationRequestdebug - true if Maven should be executed in debug mode, false if the normal mode
should be used.public InvocationRequest setErrorHandler(InvocationOutputHandler errorHandler)
setErrorHandler in interface InvocationRequesterrorHandler - The error handler, may be null if the output is not of interest.public InvocationRequest setReactorFailureBehavior(InvocationRequest.ReactorFailureBehavior failureBehavior)
setReactorFailureBehavior.
setReactorFailureBehavior in interface InvocationRequestfailureBehavior - a ReactorFailureBehavior object.InvocationRequest object.public InvocationRequest setGoals(List<String> goals)
setGoals in interface InvocationRequestgoals - The goals for the Maven invocation, may be null to execute the POMs default goal.public InvocationRequest setInputStream(InputStream inputStream)
setInputStream in interface InvocationRequestinputStream - The input stream used to provide input for the invoked Maven build, may be null
if not required.public InvocationRequest setBatchMode(boolean interactive)
-B and --batch-modesetBatchMode in interface InvocationRequestinteractive - true if Maven should be executed in non-interactive mode, false if the
interactive modes is used.public InvocationRequest setLocalRepositoryDirectory(File localRepository)
setLocalRepositoryDirectory in interface InvocationRequestlocalRepository - The path to the base directory of the local repository, may be null.public InvocationRequest setOffline(boolean offline)
-o and --offlinesetOffline in interface InvocationRequestoffline - true if Maven should be executed in offline mode, false if the online
mode is used.public InvocationRequest setOutputHandler(InvocationOutputHandler outputHandler)
setOutputHandler in interface InvocationRequestoutputHandler - The output handler, may be null if the output is not of interest.public InvocationRequest setPomFile(File pomFile)
setPomFile in interface InvocationRequestpomFile - The path to the POM for the Maven invocation, may be null if not used.public InvocationRequest setProperties(Properties properties)
setProperties in interface InvocationRequestproperties - The system properties for the Maven invocation, may be null if not set.public InvocationRequest setShowErrors(boolean showErrors)
-e and --errorssetShowErrors in interface InvocationRequestshowErrors - true if Maven should print stack traces, false otherwise.public InvocationRequest setUpdateSnapshots(boolean updateSnapshots)
-U and
--update-snapshotssetUpdateSnapshots in interface InvocationRequestupdateSnapshots - true if plugins and snapshots should be updated, false
otherwise.public boolean isShellEnvironmentInherited()
isShellEnvironmentInherited.
isShellEnvironmentInherited in interface InvocationRequestMavenCommandLineBuilder.setShellEnvironment(InvocationRequest, Commandline)public InvocationRequest setShellEnvironmentInherited(boolean shellEnvironmentInherited)
setShellEnvironmentInherited in interface InvocationRequestshellEnvironmentInherited - true if the environment variables should be propagated,
false otherwise.public File getJavaHome()
Getter for the field javaHome.
getJavaHome in interface InvocationRequestFile object.public InvocationRequest setJavaHome(File javaHome)
setJavaHome in interface InvocationRequestjavaHome - The path to the base directory of the Java installation used to run Maven, may be
null to use the default Java home.public File getUserSettingsFile()
getUserSettingsFile in interface InvocationRequestFile object.public InvocationRequest setUserSettingsFile(File userSettings)
-s and --settingssetUserSettingsFile in interface InvocationRequestuserSettings - The path to the user settings for the Maven invocation, may be null to load the
user settings from the default location.public File getGlobalSettingsFile()
getGlobalSettingsFile in interface InvocationRequestFile object.public InvocationRequest setGlobalSettingsFile(File globalSettings)
-gs and
--global-settingssetGlobalSettingsFile in interface InvocationRequestglobalSettings - The path to the global settings for the Maven invocation, may be null to load
the global settings from the default location.public File getToolchainsFile()
getToolchainsFile in interface InvocationRequestFile object.public InvocationRequest setToolchainsFile(File toolchains)
-t or --toolchainssetToolchainsFile in interface InvocationRequesttoolchains - the alternate path for the user toolchains filepublic File getGlobalToolchainsFile()
getGlobalToolchainsFile in interface InvocationRequestFile object.public InvocationRequest setGlobalToolchainsFile(File toolchains)
-gt or --global-toolchainssetGlobalToolchainsFile in interface InvocationRequesttoolchains - the alternate path for the global toolchains filepublic InvocationRequest.CheckSumPolicy getGlobalChecksumPolicy()
getGlobalChecksumPolicy in interface InvocationRequestpublic InvocationRequest setGlobalChecksumPolicy(InvocationRequest.CheckSumPolicy globalChecksumPolicy)
-c or --lax-checksums, -C
or --strict-checksumssetGlobalChecksumPolicy in interface InvocationRequestglobalChecksumPolicy - a CheckSumPolicy object.InvocationRequest object.public String getPomFileName()
InvocationRequest.getPomFile() does not return null. Otherwise, the base directory is assumed to contain a
POM with this name. By default, a file named pom.xml is used.getPomFileName in interface InvocationRequestString object.public InvocationRequest addArg(String arg)
InvocationRequestaddArg in interface InvocationRequestarg - a raw Maven arg linepublic List<String> getArgs()
InvocationRequestgetArgs in interface InvocationRequestpublic InvocationRequest setPomFileName(String pomFilename)
InvocationRequest.getPomFile() does not return null. Otherwise, the base directory is assumed to contain a
POM with this name.setPomFileName in interface InvocationRequestpomFilename - The (unqualified) filename of the POM for the Maven invocation, may be null if
not used.public List<String> getProfiles()
getProfiles in interface InvocationRequestList object.public InvocationRequest setProfiles(List<String> profiles)
-P and --active-profilessetProfiles in interface InvocationRequestprofiles - The profiles for the Maven invocation, may be null to use the default profiles.public boolean isNonPluginUpdates()
isNonPluginUpdates in interface InvocationRequestpublic InvocationRequest setNonPluginUpdates(boolean nonPluginUpdates)
Equivalent of -npu or --no-plugin-updates
note: Ineffective with Maven3, only kept for backward compatibility
setNonPluginUpdates in interface InvocationRequestnonPluginUpdates - true if plugin updates should be suppressed, false otherwise.public InvocationRequest addShellEnvironment(String name, String value)
addShellEnvironment in interface InvocationRequestname - The name of the environment variable, must not be null.value - The value of the environment variable, must not be null.public Map<String,String> getShellEnvironments()
Getter for the field shellEnvironments.
getShellEnvironments in interface InvocationRequestMap object.public String getMavenOpts()
Getter for the field mavenOpts.
getMavenOpts in interface InvocationRequestString object.public InvocationRequest setMavenOpts(String mavenOpts)
MAVEN_OPTS environment variable.setMavenOpts in interface InvocationRequestmavenOpts - The value of the MAVEN_OPTS environment variable, may be null to use
the default options.public boolean isShowVersion()
isShowVersion.
isShowVersion in interface InvocationRequestInvocationRequest.isShowVersion()public InvocationRequest setShowVersion(boolean showVersion)
-V or --show-versionsetShowVersion in interface InvocationRequestshowVersion - enable displaying versionpublic String getThreads()
threads argument.getThreads in interface InvocationRequestString object.public InvocationRequest setThreads(String threads)
-T or --threads
note: available since Maven3
setThreads in interface InvocationRequestthreads - the threadcountpublic List<String> getProjects()
getProjects in interface InvocationRequestList object.public InvocationRequest setProjects(List<String> projects)
-pl or --projectssetProjects in interface InvocationRequestprojects - the reactor project listpublic boolean isAlsoMake()
also-make argument.isAlsoMake in interface InvocationRequestpublic InvocationRequest setAlsoMake(boolean alsoMake)
-am or --also-makesetAlsoMake in interface InvocationRequestalsoMake - enable 'also make' modepublic boolean isAlsoMakeDependents()
also-make-dependentsisAlsoMakeDependents in interface InvocationRequestpublic InvocationRequest setAlsoMakeDependents(boolean alsoMakeDependents)
-amd or --also-make-dependentssetAlsoMakeDependents in interface InvocationRequestalsoMakeDependents - enable 'also make' modepublic String getResumeFrom()
resume-fromgetResumeFrom in interface InvocationRequestString object.public InvocationRequest setResumeFrom(String resumeFrom)
-rf or --resume-fromsetResumeFrom in interface InvocationRequestresumeFrom - set the project to resume frompublic InvocationRequest setBuilder(String id)
-b id or --builder id.
Note. This is available since Maven 3.2.1setBuilder in interface InvocationRequestid - The builder id.InvocationRequestpublic String getBuilder()
--builder id. Note. This is available since
Maven 3.2.1getBuilder in interface InvocationRequestString object.public int getTimeoutInSeconds()
getTimeoutInSeconds.
getTimeoutInSeconds in interface InvocationRequestpublic void setTimeoutInSeconds(int timeoutInSeconds)
setTimeoutInSeconds.
setTimeoutInSeconds in interface InvocationRequesttimeoutInSeconds - the timeout in seconds to execute the projectpublic boolean isQuiet()
isQuiet in interface InvocationRequestpublic InvocationRequest setQuiet(boolean quiet)
-q and --quietsetQuiet in interface InvocationRequestquiet - true if Maven should be executed in quiet mode, false if the normal mode
should be used.public boolean isNoTransferProgress()
InvocationRequestno-transfer-progress argument.isNoTransferProgress in interface InvocationRequesttrue if the argument no-transfer-progress was specified, otherwise falsepublic InvocationRequest setNoTransferProgress(boolean noTransferProgress)
InvocationRequest-ntp or --no-transfer-progresssetNoTransferProgress in interface InvocationRequestnoTransferProgress - enable no transfer progress modepublic File getMavenHome()
getMavenHome in interface InvocationRequestnull if using the default
Maven installation.public InvocationRequest setMavenHome(File mavenHome)
maven.home.setMavenHome in interface InvocationRequestmavenHome - The path to the base directory of the Maven installation, may be null to use the
default Maven installation.public File getMavenExecutable()
getMavenExecutable in interface InvocationRequestnullpublic InvocationRequest setMavenExecutable(File mavenExecutable)
mavenExecutable can either be a file relative to ${maven.home}/bin/ or an absolute file.setMavenExecutable in interface InvocationRequestmavenExecutable - the executableCopyright © 2002–2022 The Apache Software Foundation. All rights reserved.