public interface InvocationRequest
Modifier and Type | Interface and Description |
---|---|
static class |
InvocationRequest.CheckSumPolicy
The kind of checksum policy which should be used during Maven invocation.
|
static class |
InvocationRequest.ReactorFailureBehavior
The reactor failure behavior which to be used during Maven invocation.
|
Modifier and Type | Field and Description |
---|---|
static int |
NO_TIMEOUT
Constant
NO_TIMEOUT=0 |
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()
Gets the path to the base directory of the POM for the Maven invocation.
|
File |
getBaseDirectory(File defaultDirectory)
Gets the path to the base directory of the POM for the Maven invocation.
|
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()
Gets the goals for the Maven invocation.
|
InputStream |
getInputStream(InputStream defaultStream)
Gets the input stream used to provide input for the invoked Maven build.
|
File |
getJavaHome()
Gets the path to the base directory of the Java installation used to run Maven.
|
File |
getLocalRepositoryDirectory(File defaultDirectory)
Gets the path to the base directory of the local repository to use for the Maven invocation.
|
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()
Gets the value of the
MAVEN_OPTS environment variable. |
InvocationOutputHandler |
getOutputHandler(InvocationOutputHandler defaultHandler)
Gets the handler used to capture the standard output from the Maven build.
|
File |
getPomFile()
Gets the path to the POM for the Maven invocation.
|
String |
getPomFileName()
Gets the (unqualified) filename of the POM for the Maven invocation.
|
List<String> |
getProfiles()
Gets the profiles for the Maven invocation.
|
List<String> |
getProjects()
A list of specified reactor projects to build instead of all projects.
|
Properties |
getProperties()
Gets the system properties for the Maven invocation.
|
InvocationRequest.ReactorFailureBehavior |
getReactorFailureBehavior()
Gets the failure mode of the Maven invocation.
|
String |
getResumeFrom()
Get the value of
resume-from |
Map<String,String> |
getShellEnvironments()
Gets the environment variables for the Maven invocation.
|
String |
getThreads()
Get the value of the
threads argument. |
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()
By default, Maven is executed in batch mode.
|
boolean |
isDebug()
Gets the debug mode of the Maven invocation.
|
boolean |
isNonPluginUpdates()
Indicates whether Maven should check for plugin updates.
|
boolean |
isNoTransferProgress()
Get the value of the
no-transfer-progress argument. |
boolean |
isOffline()
Gets the network mode of the Maven invocation.
|
boolean |
isQuiet()
Gets the quiet mode of the Maven invocation.
|
boolean |
isRecursive()
Gets the recursion behavior of a reactor invocation.
|
boolean |
isShellEnvironmentInherited()
Indicates whether the environment variables of the current process should be propagated to the Maven invocation.
|
boolean |
isShowErrors()
Gets the exception output mode of the Maven invocation.
|
boolean |
isShowVersion()
The show version behavior (-V option)
|
boolean |
isUpdateSnapshots()
Indicates whether Maven should enforce an update check for plugins and snapshots.
|
InvocationRequest |
setAlsoMake(boolean alsoMake)
Enable the 'also make' mode.
|
InvocationRequest |
setAlsoMakeDependents(boolean alsoMakeDependents)
Enable the 'also make dependents' mode.
|
InvocationRequest |
setBaseDirectory(File basedir)
Sets the path to the base directory of the POM for the Maven invocation.
|
InvocationRequest |
setBatchMode(boolean batchMode)
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)
Sets the failure mode of the Maven invocation.
|
InvocationRequest |
setRecursive(boolean recursive)
Sets the recursion behavior of a reactor invocation.
|
InvocationRequest |
setResumeFrom(String resumeFrom)
Resume reactor from specified project.
|
InvocationRequest |
setShellEnvironmentInherited(boolean shellEnvironmentInherited)
Specifies whether the environment variables of the current process should be propagated to the Maven invocation.
|
InvocationRequest |
setShowErrors(boolean showErrors)
Sets the exception output mode of the Maven invocation.
|
InvocationRequest |
setShowVersion(boolean showVersion)
enable displaying version without stopping the build Equivalent of
-V or --show-version |
InvocationRequest |
setThreads(String threads)
Thread count, for instance 2.0C where C is core multiplied Equivalent of
-T or --threads |
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.
|
static final int NO_TIMEOUT
NO_TIMEOUT=0
boolean isBatchMode()
true
if Maven should be executed in batch mode, false
if Maven is executed in
interactive mode.boolean isOffline()
true
if Maven should be executed in offline mode, false
if the online mode is
used.boolean isUpdateSnapshots()
true
if plugins and snapshots should be updated, false
otherwise.boolean isRecursive()
true
if sub modules should be build, false
otherwise.List<String> getProjects()
null
boolean isAlsoMake()
also-make
argument.true
if the argument also-make
was specified, otherwise false
boolean isAlsoMakeDependents()
also-make-dependents
true
if the argument also-make-dependents
was specified, otherwise false
String getResumeFrom()
resume-from
boolean isDebug()
true
if Maven should be executed in debug mode, false
if the normal mode should
be used.boolean isShowErrors()
true
if Maven should print stack traces, false
otherwise.boolean isShellEnvironmentInherited()
true
if the environment variables should be propagated, false
otherwise.boolean isNonPluginUpdates()
true
if plugin updates should be suppressed, false
otherwise.InvocationRequest.ReactorFailureBehavior getReactorFailureBehavior()
InvocationRequest.ReactorFailureBehavior.FailFast
is
used.InvocationRequest.ReactorFailureBehavior.FailFast
,
InvocationRequest.ReactorFailureBehavior.FailAtEnd
and InvocationRequest.ReactorFailureBehavior.FailNever
.File getLocalRepositoryDirectory(File defaultDirectory)
defaultDirectory
- 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
.InputStream getInputStream(InputStream defaultStream)
defaultStream
- the default InputStream
to usenull
if not set.InvocationOutputHandler getOutputHandler(InvocationOutputHandler defaultHandler)
defaultHandler
- the default InvocationOutputHandler
to usenull
if not set.InvocationOutputHandler getErrorHandler(InvocationOutputHandler defaultHandler)
defaultHandler
- the default InvocationOutputHandler
to usenull
if not set.File getPomFile()
null
if not set.String getPomFileName()
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.null
if not set.List<String> getArgs()
File getBaseDirectory()
getPomFile()
does not return
null
, this setting only affects the working directory for the Maven invocation.null
if not set.File getBaseDirectory(File defaultDirectory)
getPomFile()
does not return
null
, this setting only affects the working directory for the Maven invocation.defaultDirectory
- The default base directory to use if none is configured for this request, may be
null
.null
if not set.File getJavaHome()
null
to use the
default Java home.Properties getProperties()
null
if not set.List<String> getGoals()
null
if not set.File getUserSettingsFile()
null
to load the user settings
from the default location.File getGlobalSettingsFile()
null
to load the global settings
from the default location.File getToolchainsFile()
null
to load the toolchains from the default
locationFile getGlobalToolchainsFile()
null
to load the global toolchains from the
default location.InvocationRequest.CheckSumPolicy getGlobalChecksumPolicy()
InvocationRequest.CheckSumPolicy.Warn
and InvocationRequest.CheckSumPolicy.Fail
.List<String> getProfiles()
null
if not set.Map<String,String> getShellEnvironments()
null
if not set.String getMavenOpts()
MAVEN_OPTS
environment variable.MAVEN_OPTS
environment variable or null
if not set.boolean isShowVersion()
String getThreads()
threads
argument.threads
argument or null
if not setboolean isQuiet()
true
if Maven should be executed in quiet mode, false
if normal mode should
be used.boolean isNoTransferProgress()
no-transfer-progress
argument.true
if the argument no-transfer-progress
was specified, otherwise false
InvocationRequest setBatchMode(boolean batchMode)
-B
and --batch-mode
batchMode
- true
if Maven should be executed in non-interactive mode, false
if the
interactive modes is used.InvocationRequest setOffline(boolean offline)
-o
and --offline
offline
- true
if Maven should be executed in offline mode, false
if the online
mode is used.InvocationRequest setDebug(boolean debug)
-X
and --debug
debug
- true
if Maven should be executed in debug mode, false
if the normal mode
should be used.InvocationRequest setShowErrors(boolean showErrors)
-e
and --errors
showErrors
- true
if Maven should print stack traces, false
otherwise.InvocationRequest setUpdateSnapshots(boolean updateSnapshots)
-U
and
--update-snapshots
updateSnapshots
- true
if plugins and snapshots should be updated, false
otherwise.InvocationRequest setReactorFailureBehavior(InvocationRequest.ReactorFailureBehavior failureBehavior)
-ff
and --fail-fast
, -fae
and --fail-at-end
, -fn
and --fail-never
failureBehavior
- The failure mode, must be one of InvocationRequest.ReactorFailureBehavior.FailFast
,
InvocationRequest.ReactorFailureBehavior.FailAtEnd
and InvocationRequest.ReactorFailureBehavior.FailNever
.InvocationRequest setLocalRepositoryDirectory(File localRepository)
localRepository
- The path to the base directory of the local repository, may be null
.InvocationRequest setInputStream(InputStream inputStream)
inputStream
- The input stream used to provide input for the invoked Maven build, may be null
if not required.InvocationRequest setOutputHandler(InvocationOutputHandler outputHandler)
outputHandler
- The output handler, may be null
if the output is not of interest.InvocationRequest setErrorHandler(InvocationOutputHandler errorHandler)
errorHandler
- The error handler, may be null
if the output is not of interest.InvocationRequest setPomFile(File pomFile)
pomFile
- The path to the POM for the Maven invocation, may be null
if not used.InvocationRequest setPomFileName(String pomFilename)
getPomFile()
does not return null
. Otherwise, the base directory is assumed to contain a
POM with this name.pomFilename
- The (unqualified) filename of the POM for the Maven invocation, may be null
if
not used.InvocationRequest addArg(String arg)
arg
- a raw Maven arg lineInvocationRequest setBaseDirectory(File basedir)
getPomFile()
does not return
null
, this setting only affects the working directory for the Maven invocation.basedir
- The path to the base directory of the POM, may be null
if not used.InvocationRequest setJavaHome(File javaHome)
javaHome
- The path to the base directory of the Java installation used to run Maven, may be
null
to use the default Java home.InvocationRequest setProperties(Properties properties)
properties
- The system properties for the Maven invocation, may be null
if not set.InvocationRequest setGoals(List<String> goals)
goals
- The goals for the Maven invocation, may be null
to execute the POMs default goal.InvocationRequest setProfiles(List<String> profiles)
-P
and --active-profiles
profiles
- The profiles for the Maven invocation, may be null
to use the default profiles.InvocationRequest setShellEnvironmentInherited(boolean shellEnvironmentInherited)
shellEnvironmentInherited
- true
if the environment variables should be propagated,
false
otherwise.InvocationRequest setUserSettingsFile(File userSettings)
-s
and --settings
userSettings
- The path to the user settings for the Maven invocation, may be null
to load the
user settings from the default location.InvocationRequest setGlobalSettingsFile(File globalSettings)
-gs
and
--global-settings
globalSettings
- The path to the global settings for the Maven invocation, may be null
to load
the global settings from the default location.InvocationRequest setToolchainsFile(File toolchains)
-t
or --toolchains
toolchains
- the alternate path for the user toolchains fileInvocationRequest setGlobalToolchainsFile(File toolchains)
-gt
or --global-toolchains
toolchains
- the alternate path for the global toolchains fileInvocationRequest setGlobalChecksumPolicy(InvocationRequest.CheckSumPolicy globalChecksumPolicy)
-c
or --lax-checksums
, -C
or --strict-checksums
globalChecksumPolicy
- The checksum mode, must be one of InvocationRequest.CheckSumPolicy.Warn
and
InvocationRequest.CheckSumPolicy.Fail
.InvocationRequest setNonPluginUpdates(boolean nonPluginUpdates)
Equivalent of -npu
or --no-plugin-updates
note: Ineffective with Maven3, only kept for backward compatibility
nonPluginUpdates
- true
if plugin updates should be suppressed, false
otherwise.InvocationRequest setRecursive(boolean recursive)
-N
and
--non-recursive
recursive
- true
if sub modules should be build, false
otherwise.InvocationRequest addShellEnvironment(String name, String value)
name
- The name of the environment variable, must not be null
.value
- The value of the environment variable, must not be null
.InvocationRequest setMavenOpts(String mavenOpts)
MAVEN_OPTS
environment variable.mavenOpts
- The value of the MAVEN_OPTS
environment variable, may be null
to use
the default options.InvocationRequest setShowVersion(boolean showVersion)
-V
or --show-version
showVersion
- enable displaying versionInvocationRequest setThreads(String threads)
-T
or --threads
note: available since Maven3
threads
- the threadcountInvocationRequest setProjects(List<String> projects)
-pl
or --projects
projects
- the reactor project listInvocationRequest setAlsoMake(boolean alsoMake)
-am
or --also-make
alsoMake
- enable 'also make' modeInvocationRequest setAlsoMakeDependents(boolean alsoMakeDependents)
-amd
or --also-make-dependents
alsoMakeDependents
- enable 'also make' modeInvocationRequest setResumeFrom(String resumeFrom)
-rf
or --resume-from
resumeFrom
- set the project to resume fromInvocationRequest setBuilder(String id)
-b id
or --builder id
.
Note. This is available since Maven 3.2.1id
- The builder id.InvocationRequest
InvocationRequest setQuiet(boolean quiet)
-q
and --quiet
quiet
- true
if Maven should be executed in quiet mode, false
if the normal mode
should be used.InvocationRequest setNoTransferProgress(boolean noTransferProgress)
-ntp
or --no-transfer-progress
noTransferProgress
- enable no transfer progress modeString getBuilder()
--builder id
. Note. This is available since
Maven 3.2.1int getTimeoutInSeconds()
getTimeoutInSeconds.
void setTimeoutInSeconds(int timeoutInSeconds)
setTimeoutInSeconds.
timeoutInSeconds
- the timeout in seconds to execute the projectFile getMavenHome()
null
if using the default
Maven installation.InvocationRequest setMavenHome(File mavenHome)
maven.home
.mavenHome
- The path to the base directory of the Maven installation, may be null
to use the
default Maven installation.File getMavenExecutable()
null
InvocationRequest setMavenExecutable(File mavenExecutable)
mavenExecutable
can either be a file relative to ${maven.home}/bin/ or an absolute file.mavenExecutable
- the executableCopyright © 2002–2022 The Apache Software Foundation. All rights reserved.