diff --git a/src/main/java/org/apache/maven/shared/invoker/CommandLineConfigurationException.java b/src/main/java/org/apache/maven/shared/invoker/CommandLineConfigurationException.java
index 1877c33..959463d 100644
--- a/src/main/java/org/apache/maven/shared/invoker/CommandLineConfigurationException.java
+++ b/src/main/java/org/apache/maven/shared/invoker/CommandLineConfigurationException.java
@@ -31,7 +31,7 @@ public class CommandLineConfigurationException
/**
* Creates a new exception using the specified detail message and cause.
- *
+ *
* @param message The detail message for this exception, may be null
.
* @param cause The nested exception, may be null
.
*/
@@ -42,7 +42,7 @@ public CommandLineConfigurationException( String message, Throwable cause )
/**
* Creates a new exception using the specified detail message.
- *
+ *
* @param message The detail message for this exception, may be null
.
*/
public CommandLineConfigurationException( String message )
diff --git a/src/main/java/org/apache/maven/shared/invoker/DefaultInvocationRequest.java b/src/main/java/org/apache/maven/shared/invoker/DefaultInvocationRequest.java
index 9b5655f..93be2ba 100644
--- a/src/main/java/org/apache/maven/shared/invoker/DefaultInvocationRequest.java
+++ b/src/main/java/org/apache/maven/shared/invoker/DefaultInvocationRequest.java
@@ -107,170 +107,250 @@ public class DefaultInvocationRequest
private boolean quiet;
+ /**
+ *
getBaseDirectory.
+ * + * @return a {@link java.io.File} object. + */ public File getBaseDirectory() { return basedir; } + /** {@inheritDoc} */ public File getBaseDirectory( File defaultDirectory ) { return basedir == null ? defaultDirectory : basedir; } + /** {@inheritDoc} */ public InvocationOutputHandler getErrorHandler( InvocationOutputHandler defaultHandler ) { return errorHandler == null ? defaultHandler : errorHandler; } + /** + *getReactorFailureBehavior.
+ * + * @return a ReactorFailureBehavior object. + */ public ReactorFailureBehavior getReactorFailureBehavior() { return failureBehavior; } + /** + *Getter for the field goals
.
Getter for the field pomFile
.
Getter for the field properties
.
isDebug.
+ * + * @return a boolean. + */ public boolean isDebug() { return debug; } + /** + *isBatchMode.
+ * + * @return a boolean. + */ public boolean isBatchMode() { return interactive; } + /** + *isOffline.
+ * + * @return a boolean. + */ public boolean isOffline() { return offline; } + /** + *isShowErrors.
+ * + * @return a boolean. + */ public boolean isShowErrors() { return showErrors; } + /** + *isUpdateSnapshots.
+ * + * @return a boolean. + */ public boolean isUpdateSnapshots() { return updateSnapshots; } + /** + *isRecursive.
+ * + * @return a boolean. + */ public boolean isRecursive() { return recursive; } + /** {@inheritDoc} */ public InvocationRequest setRecursive( boolean recursive ) { this.recursive = recursive; return this; } + /** {@inheritDoc} */ public InvocationRequest setBaseDirectory( File basedir ) { this.basedir = basedir; return this; } + /** {@inheritDoc} */ public InvocationRequest setDebug( boolean debug ) { this.debug = debug; return this; } + /** {@inheritDoc} */ public InvocationRequest setErrorHandler( InvocationOutputHandler errorHandler ) { this.errorHandler = errorHandler; return this; } + /** + *setReactorFailureBehavior.
+ * + * @param failureBehavior a ReactorFailureBehavior object. + * @return a {@link org.apache.maven.shared.invoker.InvocationRequest} object. + */ public InvocationRequest setReactorFailureBehavior( ReactorFailureBehavior failureBehavior ) { this.failureBehavior = failureBehavior; return this; } + /** {@inheritDoc} */ public InvocationRequest setGoals( ListisShellEnvironmentInherited.
+ * * @see MavenCommandLineBuilder#setShellEnvironment(InvocationRequest, Commandline) + * @return a boolean. */ public boolean isShellEnvironmentInherited() { return shellEnvironmentInherited; } + /** {@inheritDoc} */ public InvocationRequest setShellEnvironmentInherited( boolean shellEnvironmentInherited ) { this.shellEnvironmentInherited = shellEnvironmentInherited; return this; } + /** + *Getter for the field javaHome
.
Getter for the field shellEnvironments
.
Getter for the field mavenOpts
.
isShowVersion.
+ * * @see org.apache.maven.shared.invoker.InvocationRequest#isShowVersion() + * @return a boolean. */ public boolean isShowVersion() { return this.showVersion; } - /** - * @see org.apache.maven.shared.invoker.InvocationRequest#setShowVersion(boolean) - */ + /** {@inheritDoc} */ public InvocationRequest setShowVersion( boolean showVersion ) { this.showVersion = showVersion; @@ -487,15 +592,15 @@ public InvocationRequest setShowVersion( boolean showVersion ) /** * {@inheritDoc} + * + * @return a {@link java.lang.String} object. */ public String getThreads() { return threads; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public InvocationRequest setThreads( String threads ) { this.threads = threads; @@ -504,15 +609,15 @@ public InvocationRequest setThreads( String threads ) /** * {@inheritDoc} + * + * @return a {@link java.util.List} object. */ public ListGetter for the field exitCode
.
Getter for the field executionException
.
ROLE_HINT="default"
*/
public static final String ROLE_HINT = "default";
private static final InvokerLogger DEFAULT_LOGGER = new SystemOutLogger();
@@ -61,6 +62,7 @@ public class DefaultInvoker
private InvocationOutputHandler errorHandler = DEFAULT_OUTPUT_HANDLER;
+ /** {@inheritDoc} */
public InvocationResult execute( InvocationRequest request )
throws MavenInvocationException
{
@@ -164,44 +166,68 @@ private int executeCommandLine( Commandline cli, InvocationRequest request, int
return result;
}
+ /**
+ * Getter for the field localRepositoryDirectory
.
Getter for the field logger
.
Getter for the field workingDirectory
.
Getter for the field mavenHome
.
Getter for the field mavenExecutable
.
true
if Maven should be executed in batch mode, false
if Maven is executed in
* interactive mode.
* @since 3.0.0
@@ -43,7 +43,7 @@ public interface InvocationRequest
/**
* Gets the network mode of the Maven invocation. By default, Maven is executed in online mode.
- *
+ *
* @return true
if Maven should be executed in offline mode, false
if the online mode is
* used.
*/
@@ -52,14 +52,14 @@ public interface InvocationRequest
/**
* Indicates whether Maven should enforce an update check for plugins and snapshots. By default, no update check is
* performed.
- *
+ *
* @return true
if plugins and snapshots should be updated, false
otherwise.
*/
boolean isUpdateSnapshots();
/**
* Gets the recursion behavior of a reactor invocation. By default, Maven will recursive the build into sub modules.
- *
+ *
* @return true
if sub modules should be build, false
otherwise.
*/
boolean isRecursive();
@@ -67,7 +67,7 @@ public interface InvocationRequest
/**
* 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.
- *
+ *
* @return the list of projects to add to reactor build, otherwise {@code null}
* @since 2.1
*/
@@ -75,7 +75,7 @@ public interface InvocationRequest
/**
* Get the value of the {@code also-make} argument.
- *
+ *
* @return {@code true} if the argument {@code also-make} was specified, otherwise {@code false}
* @since 2.1
*/
@@ -83,7 +83,7 @@ public interface InvocationRequest
/**
* Get the value of the {@code also-make-dependents}
- *
+ *
* @return {@code true} if the argument {@code also-make-dependents} was specified, otherwise {@code false}
* @since 2.1
*/
@@ -91,7 +91,7 @@ public interface InvocationRequest
/**
* Get the value of {@code resume-from}
- *
+ *
* @return specified reactor project to resume from
* @since 2.1
*/
@@ -99,7 +99,7 @@ public interface InvocationRequest
/**
* Gets the debug mode of the Maven invocation. By default, Maven is executed in normal mode.
- *
+ *
* @return true
if Maven should be executed in debug mode, false
if the normal mode should
* be used.
*/
@@ -108,7 +108,7 @@ public interface InvocationRequest
/**
* Gets the exception output mode of the Maven invocation. By default, Maven will not print stack traces of build
* exceptions.
- *
+ *
* @return true
if Maven should print stack traces, false
otherwise.
*/
boolean isShowErrors();
@@ -116,14 +116,14 @@ public interface InvocationRequest
/**
* Indicates whether the environment variables of the current process should be propagated to the Maven invocation.
* By default, the current environment variables are inherited by the new Maven invocation.
- *
+ *
* @return true
if the environment variables should be propagated, false
otherwise.
*/
boolean isShellEnvironmentInherited();
/**
* Indicates whether Maven should check for plugin updates. By default, plugin updates are not suppressed.
- *
+ *
* @return true
if plugin updates should be suppressed, false
otherwise.
*/
boolean isNonPluginUpdates();
@@ -131,7 +131,7 @@ public interface InvocationRequest
/**
* Gets the failure mode of the Maven invocation. By default, the mode {@link ReactorFailureBehavior#FailFast} is
* used.
- *
+ *
* @return The failure mode, one of {@link ReactorFailureBehavior#FailFast},
* {@link ReactorFailureBehavior#FailAtEnd} and {@link ReactorFailureBehavior#FailNever}.
* @since 3.0.0
@@ -140,7 +140,7 @@ public interface InvocationRequest
/**
* Gets the path to the base directory of the local repository to use for the Maven invocation.
- *
+ *
* @param defaultDirectory The default location to use if no location is configured for this request, may be
* null
.
* @return The path to the base directory of the local repository or null
to use the location from the
@@ -152,7 +152,7 @@ public interface InvocationRequest
* Gets the input stream used to provide input for the invoked Maven build. This is in particular useful when
* invoking Maven in interactive mode.
*
- * @param defaultStream the default {@link InputStream} to use
+ * @param defaultStream the default {@link java.io.InputStream} to use
* @return The input stream used to provide input for the invoked Maven build or null
if not set.
*/
InputStream getInputStream( InputStream defaultStream );
@@ -160,7 +160,7 @@ public interface InvocationRequest
/**
* Gets the handler used to capture the standard output from the Maven build.
*
- * @param defaultHandler the default {@link InvocationOutputHandler} to use
+ * @param defaultHandler the default {@link org.apache.maven.shared.invoker.InvocationOutputHandler} to use
* @return The output handler or null
if not set.
*/
InvocationOutputHandler getOutputHandler( InvocationOutputHandler defaultHandler );
@@ -168,7 +168,7 @@ public interface InvocationRequest
/**
* Gets the handler used to capture the error output from the Maven build.
*
- * @param defaultHandler the default {@link InvocationOutputHandler} to use
+ * @param defaultHandler the default {@link org.apache.maven.shared.invoker.InvocationOutputHandler} to use
* @return The error handler or null
if not set.
*/
InvocationOutputHandler getErrorHandler( InvocationOutputHandler defaultHandler );
@@ -176,7 +176,7 @@ public interface InvocationRequest
/**
* Gets the path to the POM for the Maven invocation. If no base directory is set, the parent directory of this POM
* will be used as the working directory for the Maven invocation.
- *
+ *
* @return The path to the POM for the Maven invocation or null
if not set.
*/
File getPomFile();
@@ -185,7 +185,7 @@ public interface InvocationRequest
* Gets the (unqualified) filename of the POM for the Maven invocation. This setting is ignored if
* {@link #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.
- *
+ *
* @return The (unqualified) filename of the POM for the Maven invocation or null
if not set.
*/
String getPomFileName();
@@ -193,7 +193,7 @@ public interface InvocationRequest
/**
* Gets the path to the base directory of the POM for the Maven invocation. If {@link #getPomFile()} does not return
* null
, this setting only affects the working directory for the Maven invocation.
- *
+ *
* @return The path to the base directory of the POM or null
if not set.
*/
File getBaseDirectory();
@@ -201,7 +201,7 @@ public interface InvocationRequest
/**
* Gets the path to the base directory of the POM for the Maven invocation. If {@link #getPomFile()} does not return
* null
, this setting only affects the working directory for the Maven invocation.
- *
+ *
* @param defaultDirectory The default base directory to use if none is configured for this request, may be
* null
.
* @return The path to the base directory of the POM or null
if not set.
@@ -210,7 +210,7 @@ public interface InvocationRequest
/**
* Gets the path to the base directory of the Java installation used to run Maven.
- *
+ *
* @return The path to the base directory of the Java installation used to run Maven or null
to use the
* default Java home.
*/
@@ -218,21 +218,21 @@ public interface InvocationRequest
/**
* Gets the system properties for the Maven invocation.
- *
+ *
* @return The system properties for the Maven invocation or null
if not set.
*/
Properties getProperties();
/**
* Gets the goals for the Maven invocation.
- *
+ *
* @return The goals for the Maven invocation or null
if not set.
*/
Listnull
to load the user settings
* from the default location.
*/
@@ -240,7 +240,7 @@ public interface InvocationRequest
/**
* Gets the path to the global settings for the Maven invocation.
- *
+ *
* @return The path to the global settings for the Maven invocation or null
to load the global settings
* from the default location.
* @since 2.1
@@ -249,7 +249,7 @@ public interface InvocationRequest
/**
* Gets the path to the custom toolchains file
- *
+ *
* @return The path to the custom toolchains file or null
to load the toolchains from the default
* location
* @since 2.1
@@ -258,7 +258,7 @@ public interface InvocationRequest
/**
* Alternate path for the global toolchains file Note. This is available since Maven 3.3.1
- *
+ *
* @return The path to the custom global toolchains file or null
to load the global toolchains from the
* default location.
* @since 3.0.0
@@ -267,7 +267,7 @@ public interface InvocationRequest
/**
* Gets the checksum mode of the Maven invocation.
- *
+ *
* @return The checksum mode, one of {@link CheckSumPolicy#Warn} and {@link CheckSumPolicy#Fail}.
* @since 3.0.0
*/
@@ -275,28 +275,28 @@ public interface InvocationRequest
/**
* Gets the profiles for the Maven invocation.
- *
+ *
* @return The profiles for the Maven invocation or null
if not set.
*/
Listnull
if not set.
*/
MapMAVEN_OPTS
environment variable.
- *
+ *
* @return The value of the MAVEN_OPTS
environment variable or null
if not set.
*/
String getMavenOpts();
/**
* The show version behavior (-V option)
- *
+ *
* @return The show version behavior
* @since 2.0.11
*/
@@ -304,7 +304,7 @@ public interface InvocationRequest
/**
* Get the value of the {@code threads} argument.
- *
+ *
* @return the value of the {@code threads} argument or {@code null} if not set
* @since 2.1
*/
@@ -315,6 +315,7 @@ public interface InvocationRequest
*
* @return true
if Maven should be executed in quiet mode, false
if normal mode should
* be used.
+ * @since 3.1.0
*/
boolean isQuiet();
@@ -408,7 +409,7 @@ enum CheckSumPolicy
/**
* Sets the interaction mode of the Maven invocation. Equivalent of {@code -B} and {@code --batch-mode}
- *
+ *
* @param batchMode true
if Maven should be executed in non-interactive mode, false
if the
* interactive modes is used.
* @return This invocation request.
@@ -418,7 +419,7 @@ enum CheckSumPolicy
/**
* Sets the network mode of the Maven invocation. Equivalent of {@code -o} and {@code --offline}
- *
+ *
* @param offline true
if Maven should be executed in offline mode, false
if the online
* mode is used.
* @return This invocation request.
@@ -427,7 +428,7 @@ enum CheckSumPolicy
/**
* Sets the debug mode of the Maven invocation. Equivalent of {@code -X} and {@code --debug}
- *
+ *
* @param debug true
if Maven should be executed in debug mode, false
if the normal mode
* should be used.
* @return This invocation request.
@@ -436,7 +437,7 @@ enum CheckSumPolicy
/**
* Sets the exception output mode of the Maven invocation. Equivalent of {@code -e} and {@code --errors}
- *
+ *
* @param showErrors true
if Maven should print stack traces, false
otherwise.
* @return This invocation request.
*/
@@ -445,7 +446,7 @@ enum CheckSumPolicy
/**
* Specifies whether Maven should enforce an update check for plugins and snapshots. Equivalent of {@code -U} and
* {@code --update-snapshots}
- *
+ *
* @param updateSnapshots true
if plugins and snapshots should be updated, false
* otherwise.
* @return This invocation request.
@@ -455,7 +456,7 @@ enum CheckSumPolicy
/**
* Sets the failure mode of the Maven invocation. Equivalent of {@code -ff} and {@code --fail-fast}, {@code -fae}
* and {@code --fail-at-end}, {@code -fn} and {@code --fail-never}
- *
+ *
* @param failureBehavior The failure mode, must be one of {@link ReactorFailureBehavior#FailFast},
* {@link ReactorFailureBehavior#FailAtEnd} and {@link ReactorFailureBehavior#FailNever}.
* @return This invocation request.
@@ -465,7 +466,7 @@ enum CheckSumPolicy
/**
* Sets the path to the base directory of the local repository to use for the Maven invocation.
- *
+ *
* @param localRepository The path to the base directory of the local repository, may be null
.
* @return This invocation request.
*/
@@ -474,7 +475,7 @@ enum CheckSumPolicy
/**
* Sets the input stream used to provide input for the invoked Maven build. This is in particular useful when
* invoking Maven in interactive mode.
- *
+ *
* @param inputStream The input stream used to provide input for the invoked Maven build, may be null
* if not required.
* @return This invocation request.
@@ -483,7 +484,7 @@ enum CheckSumPolicy
/**
* Sets the handler used to capture the standard output from the Maven build.
- *
+ *
* @param outputHandler The output handler, may be null
if the output is not of interest.
* @return This invocation request.
*/
@@ -491,7 +492,7 @@ enum CheckSumPolicy
/**
* Sets the handler used to capture the error output from the Maven build.
- *
+ *
* @param errorHandler The error handler, may be null
if the output is not of interest.
* @return This invocation request.
*/
@@ -500,7 +501,7 @@ enum CheckSumPolicy
/**
* 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.
- *
+ *
* @param pomFile The path to the POM for the Maven invocation, may be null
if not used.
* @return This invocation request.
*/
@@ -510,7 +511,7 @@ enum CheckSumPolicy
* Sets the (unqualified) filename of the POM for the Maven invocation. This setting is ignored if
* {@link #getPomFile()} does not return null
. Otherwise, the base directory is assumed to contain a
* POM with this name.
- *
+ *
* @param pomFilename The (unqualified) filename of the POM for the Maven invocation, may be null
if
* not used.
* @return This invocation request.
@@ -520,7 +521,7 @@ enum CheckSumPolicy
/**
* Sets the path to the base directory of the POM for the Maven invocation. If {@link #getPomFile()} does not return
* null
, this setting only affects the working directory for the Maven invocation.
- *
+ *
* @param basedir The path to the base directory of the POM, may be null
if not used.
* @return This invocation request.
*/
@@ -528,7 +529,7 @@ enum CheckSumPolicy
/**
* Sets the path to the base directory of the Java installation used to run Maven.
- *
+ *
* @param javaHome The path to the base directory of the Java installation used to run Maven, may be
* null
to use the default Java home.
* @return This invocation request.
@@ -537,7 +538,7 @@ enum CheckSumPolicy
/**
* Sets the system properties for the Maven invocation.
- *
+ *
* @param properties The system properties for the Maven invocation, may be null
if not set.
* @return This invocation request.
*/
@@ -545,7 +546,7 @@ enum CheckSumPolicy
/**
* Sets the goals for the Maven invocation.
- *
+ *
* @param goals The goals for the Maven invocation, may be null
to execute the POMs default goal.
* @return This invocation request.
*/
@@ -553,7 +554,7 @@ enum CheckSumPolicy
/**
* Sets the profiles for the Maven invocation. Equivalent of {@code -P} and {@code --active-profiles}
- *
+ *
* @param profiles The profiles for the Maven invocation, may be null
to use the default profiles.
* @return This invocation request.
*/
@@ -561,7 +562,7 @@ enum CheckSumPolicy
/**
* Specifies whether the environment variables of the current process should be propagated to the Maven invocation.
- *
+ *
* @param shellEnvironmentInherited true
if the environment variables should be propagated,
* false
otherwise.
* @return This invocation request.
@@ -570,7 +571,7 @@ enum CheckSumPolicy
/**
* Sets the path to the user settings for the Maven invocation. Equivalent of {@code -s} and {@code --settings}
- *
+ *
* @param userSettings The path to the user settings for the Maven invocation, may be null
to load the
* user settings from the default location.
* @return This invocation request.
@@ -580,7 +581,7 @@ enum CheckSumPolicy
/**
* Sets the path to the global settings for the Maven invocation. Equivalent of {@code -gs} and
* {@code --global-settings}
- *
+ *
* @param globalSettings The path to the global settings for the Maven invocation, may be null
to load
* the global settings from the default location.
* @return This invocation request.
@@ -590,7 +591,7 @@ enum CheckSumPolicy
/**
* Sets the alternate path for the user toolchains file Equivalent of {@code -t} or {@code --toolchains}
- *
+ *
* @param toolchains the alternate path for the user toolchains file
* @return This invocation request
* @since 2.1
@@ -599,7 +600,7 @@ enum CheckSumPolicy
/**
* Sets the alternate path for the global toolchains file Equivalent of {@code -gt} or {@code --global-toolchains}
- *
+ *
* @param toolchains the alternate path for the global toolchains file
* @return This invocation request
* @since 3.0.0
@@ -609,7 +610,7 @@ enum CheckSumPolicy
/**
* Sets the checksum mode of the Maven invocation. Equivalent of {@code -c} or {@code --lax-checksums}, {@code -C}
* or {@code --strict-checksums}
- *
+ *
* @param globalChecksumPolicy The checksum mode, must be one of {@link CheckSumPolicy#Warn} and
* {@link CheckSumPolicy#Fail}.
* @return This invocation request.
@@ -625,7 +626,7 @@ enum CheckSumPolicy
* * note: Ineffective with Maven3, only kept for backward compatibility *
- * + * * @param nonPluginUpdatestrue
if plugin updates should be suppressed, false
otherwise.
* @return This invocation request.
*/
@@ -634,7 +635,7 @@ enum CheckSumPolicy
/**
* Sets the recursion behavior of a reactor invocation. Inverse equivalent of {@code -N} and
* {@code --non-recursive}
- *
+ *
* @param recursive true
if sub modules should be build, false
otherwise.
* @return This invocation request.
*/
@@ -642,7 +643,7 @@ enum CheckSumPolicy
/**
* Adds the specified environment variable to the Maven invocation.
- *
+ *
* @param name The name of the environment variable, must not be null
.
* @param value The value of the environment variable, must not be null
.
* @return This invocation request.
@@ -651,7 +652,7 @@ enum CheckSumPolicy
/**
* Sets the value of the MAVEN_OPTS
environment variable.
- *
+ *
* @param mavenOpts The value of the MAVEN_OPTS
environment variable, may be null
to use
* the default options.
* @return This invocation request.
@@ -660,7 +661,7 @@ enum CheckSumPolicy
/**
* enable displaying version without stopping the build Equivalent of {@code -V} or {@code --show-version}
- *
+ *
* @param showVersion enable displaying version
* @return This invocation request.
* @since 2.0.11
@@ -672,7 +673,7 @@ enum CheckSumPolicy
* * note: available since Maven3 *
- * + * * @param threads the threadcount * @return This invocation request. * @since 2.1 @@ -681,7 +682,7 @@ enum CheckSumPolicy /** * Sets the reactor project list. Equivalent of {@code -pl} or {@code --projects} - * + * * @param projects the reactor project list * @return This invocation request. * @since 2.1 @@ -690,7 +691,7 @@ enum CheckSumPolicy /** * Enable the 'also make' mode. Equivalent of {@code -am} or {@code --also-make} - * + * * @param alsoMake enable 'also make' mode * @return This invocation request. * @since 2.1 @@ -699,7 +700,7 @@ enum CheckSumPolicy /** * Enable the 'also make dependents' mode. Equivalent of {@code -amd} or {@code --also-make-dependents} - * + * * @param alsoMakeDependents enable 'also make' mode * @return This invocation request. * @since 2.1 @@ -708,7 +709,7 @@ enum CheckSumPolicy /** * Resume reactor from specified project. Equivalent of {@code -rf} or {@code --resume-from} - * + * * @param resumeFrom set the project to resume from * @return This invocation request * @since 2.1 @@ -718,7 +719,7 @@ enum CheckSumPolicy /** * The id of the build strategy to use. equivalent of {@code --builder id}. Note. This is available since Maven * 3.2.1 - * + * * @param id The builder id. * @return {@link InvocationRequest} FIXME: How to identify if this is a valid command line option? * @since 3.0.0 @@ -731,26 +732,32 @@ enum CheckSumPolicy * @param quiettrue
if Maven should be executed in quiet mode, false
if the normal mode
* should be used.
* @return This invocation request.
+ * @since 3.1.0
*/
InvocationRequest setQuiet( boolean quiet );
/**
* Get the current set builder strategy id equivalent of {@code --builder id}. Note. This is available since
* Maven 3.2.1
- *
+ *
* @return The current set builder id.
* @since 3.0.0
*/
String getBuilder();
+ /** Constant NO_TIMEOUT=0
*/
int NO_TIMEOUT = 0;
/**
+ * getTimeoutInSeconds.
+ * * @since 3.0.1 * @return the timeout in seconds to execute the project */ int getTimeoutInSeconds(); /** + *setTimeoutInSeconds.
+ * * @since 3.0.1 * @param timeoutInSeconds the timeout in seconds to execute the project */ diff --git a/src/main/java/org/apache/maven/shared/invoker/Invoker.java b/src/main/java/org/apache/maven/shared/invoker/Invoker.java index 369be70..51cd6c1 100644 --- a/src/main/java/org/apache/maven/shared/invoker/Invoker.java +++ b/src/main/java/org/apache/maven/shared/invoker/Invoker.java @@ -38,7 +38,7 @@ public interface Invoker * Executes Maven using the parameters specified by the given invocation request. Parameters not specified by the * invocation request will be derived from the state of this invoker instance. In case both the invoker instance and * the invocation request provide a value for a particular option, the value from the invocation request dominates. - * + * * @param request The invocation request to execute, must not benull
.
* @return The result of the Maven invocation, never null
.
* @throws MavenInvocationException if cannot configure correctly execution parameters
@@ -48,7 +48,7 @@ InvocationResult execute( InvocationRequest request )
/**
* Gets the path to the base directory of the local repository to use for the Maven invocation.
- *
+ *
* @return The path to the base directory of the local repository or null
to use the location from
* the settings.xml
.
*/
@@ -56,7 +56,7 @@ InvocationResult execute( InvocationRequest request )
/**
* Gets the working directory for the Maven invocation.
- *
+ *
* @return The working directory for the Maven invocation or null
if the working directory is derived
* from the base directory of the processed POM.
*/
@@ -64,14 +64,14 @@ InvocationResult execute( InvocationRequest request )
/**
* Gets the logger used by this invoker to output diagnostic messages.
- *
+ *
* @return The logger used by this invoker to output diagnostic messages, never null
.
*/
InvokerLogger getLogger();
/**
* Gets the path to the base directory of the Maven installation used to invoke Maven.
- *
+ *
* @return The path to the base directory of the Maven installation or null
if using the default
* Maven installation.
*/
@@ -81,7 +81,7 @@ InvocationResult execute( InvocationRequest request )
* 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 property
* maven.home
and the environment variable M2_HOME
.
- *
+ *
* @param mavenHome The path to the base directory of the Maven installation, may be null
to use the
* default Maven installation.
* @return This invoker instance.
@@ -90,14 +90,14 @@ InvocationResult execute( InvocationRequest request )
/**
* Get the customized File of the Maven executable.
- *
- * @return the custom Maven executable, otherwise {@code null}
+ *
+ * @return the custom Maven executable, otherwise {@code null}
*/
File getMavenExecutable();
/**
* {@code mavenExecutable} can either be a file relative to ${maven.home}/bin/ or an absolute file.
- *
+ *
* @param mavenExecutable the executable
* @return This invoker instance
*/
@@ -105,7 +105,7 @@ InvocationResult execute( InvocationRequest request )
/**
* Sets the path to the base directory of the local repository to use for the Maven invocation.
- *
+ *
* @param localRepositoryDirectory The path to the base directory of the local repository or null
to
* use the location from the settings.xml
.
* @return This invoker instance.
@@ -114,7 +114,7 @@ InvocationResult execute( InvocationRequest request )
/**
* Sets the logger used by this invoker to output diagnostic messages.
- *
+ *
* @param logger The logger used by this invoker to output diagnostic messages, may be null
to use a
* default logger.
* @return This invoker instance.
@@ -123,7 +123,7 @@ InvocationResult execute( InvocationRequest request )
/**
* Sets the working directory for the Maven invocation.
- *
+ *
* @param workingDirectory The working directory for the Maven invocation, may be null
to derive the
* working directory from the base directory of the processed POM.
* @return This invoker instance.
@@ -133,7 +133,7 @@ InvocationResult execute( InvocationRequest request )
/**
* Sets the input stream used to provide input for the invoked Maven build. This is in particular useful when
* invoking Maven in interactive mode.
- *
+ *
* @param inputStream The input stream used to provide input for the invoked Maven build, may be null
* if not required.
* @return This invoker instance.
@@ -142,7 +142,7 @@ InvocationResult execute( InvocationRequest request )
/**
* Sets the handler used to capture the standard output from the Maven build.
- *
+ *
* @param outputHandler The output handler, may be null
if the output is not of interest.
* @return This invoker instance.
*/
@@ -150,7 +150,7 @@ InvocationResult execute( InvocationRequest request )
/**
* Sets the handler used to capture the error output from the Maven build.
- *
+ *
* @param errorHandler The error handler, may be null
if the output is not of interest.
* @return This invoker instance.
*/
diff --git a/src/main/java/org/apache/maven/shared/invoker/InvokerLogger.java b/src/main/java/org/apache/maven/shared/invoker/InvokerLogger.java
index 486e611..78d03ec 100644
--- a/src/main/java/org/apache/maven/shared/invoker/InvokerLogger.java
+++ b/src/main/java/org/apache/maven/shared/invoker/InvokerLogger.java
@@ -20,8 +20,8 @@
*/
/**
- * A logger used by {@link Invoker} instances to output diagnostic messages.
- *
+ * A logger used by {@link org.apache.maven.shared.invoker.Invoker} instances to output diagnostic messages.
+ *
* @see Invoker#setLogger(InvokerLogger)
* @author Jason van Zyl
*/
@@ -55,14 +55,14 @@ public interface InvokerLogger
/**
* Logs the specified debug message.
- *
+ *
* @param message The message to log, may be null
.
*/
void debug( String message );
/**
* Logs the specified debug message and the accompanying exception.
- *
+ *
* @param message The message to log, may be null
.
* @param throwable The exception to log, may be null
.
*/
@@ -70,7 +70,7 @@ public interface InvokerLogger
/**
* Tests whether debug output is enabled for this logger.
- *
+ *
* @return true
if messages with priority "debug" or above are logged, false
* otherwise.
*/
@@ -78,14 +78,14 @@ public interface InvokerLogger
/**
* Logs the specified info message.
- *
+ *
* @param message The message to log, may be null
.
*/
void info( String message );
/**
* Logs the specified info message and the accompanying exception.
- *
+ *
* @param message The message to log, may be null
.
* @param throwable The exception to log, may be null
.
*/
@@ -93,21 +93,21 @@ public interface InvokerLogger
/**
* Tests whether info output is enabled for this logger.
- *
+ *
* @return true
if messages with priority "info" or above are logged, false
otherwise.
*/
boolean isInfoEnabled();
/**
* Logs the specified warning message.
- *
+ *
* @param message The message to log, may be null
.
*/
void warn( String message );
/**
* Logs the specified warning message and the accompanying exception.
- *
+ *
* @param message The message to log, may be null
.
* @param throwable The exception to log, may be null
.
*/
@@ -115,21 +115,21 @@ public interface InvokerLogger
/**
* Tests whether warn output is enabled for this logger.
- *
+ *
* @return true
if messages with priority "warn" or above are logged, false
otherwise.
*/
boolean isWarnEnabled();
/**
* Logs the specified error message.
- *
+ *
* @param message The message to log, may be null
.
*/
void error( String message );
/**
* Logs the specified error message and the accompanying exception.
- *
+ *
* @param message The message to log, may be null
.
* @param throwable The exception to log, may be null
.
*/
@@ -137,7 +137,7 @@ public interface InvokerLogger
/**
* Tests whether error output is enabled for this logger.
- *
+ *
* @return true
if messages with priority "error" or above are logged, false
* otherwise.
*/
@@ -145,14 +145,14 @@ public interface InvokerLogger
/**
* Logs the specified fatal error message.
- *
+ *
* @param message The message to log, may be null
.
*/
void fatalError( String message );
/**
* Logs the specified fatal error message and the accompanying exception.
- *
+ *
* @param message The message to log, may be null
.
* @param throwable The exception to log, may be null
.
*/
@@ -160,7 +160,7 @@ public interface InvokerLogger
/**
* Tests whether fatal error output is enabled for this logger.
- *
+ *
* @return true
if messages with priority "fatal" or above are logged, false
* otherwise.
*/
@@ -168,7 +168,7 @@ public interface InvokerLogger
/**
* Sets the logger's threshold.
- *
+ *
* @param threshold The logger's threshold, must be one of {@link #DEBUG}, {@link #INFO}, {@link #WARN},
* {@link #ERROR} and {@link #FATAL}.
*/
@@ -176,7 +176,7 @@ public interface InvokerLogger
/**
* Gets the logger's threshold.
- *
+ *
* @return The logger's threshold, one of {@link #DEBUG}, {@link #INFO}, {@link #WARN}, {@link #ERROR} and
* {@link #FATAL}.
*/
diff --git a/src/main/java/org/apache/maven/shared/invoker/MavenCommandLineBuilder.java b/src/main/java/org/apache/maven/shared/invoker/MavenCommandLineBuilder.java
index 1b89595..d4aee47 100644
--- a/src/main/java/org/apache/maven/shared/invoker/MavenCommandLineBuilder.java
+++ b/src/main/java/org/apache/maven/shared/invoker/MavenCommandLineBuilder.java
@@ -35,7 +35,7 @@
import org.apache.maven.shared.utils.cli.Commandline;
/**
- *
+ * MavenCommandLineBuilder class.
*/ public class MavenCommandLineBuilder { @@ -54,6 +54,13 @@ public class MavenCommandLineBuilder private Properties systemEnvVars; + /** + *build.
+ * + * @param request a {@link org.apache.maven.shared.invoker.InvocationRequest} object. + * @return a {@link org.apache.maven.shared.utils.cli.Commandline} object. + * @throws org.apache.maven.shared.invoker.CommandLineConfigurationException if any. + */ public Commandline build( InvocationRequest request ) throws CommandLineConfigurationException { @@ -110,6 +117,11 @@ public Commandline build( InvocationRequest request ) return cli; } + /** + *checkRequiredState.
+ * + * @throws java.io.IOException if any. + */ protected void checkRequiredState() throws IOException { @@ -131,6 +143,12 @@ protected void checkRequiredState() } } + /** + *setSettingsLocation.
+ * + * @param request a {@link org.apache.maven.shared.invoker.InvocationRequest} object. + * @param cli a {@link org.apache.maven.shared.utils.cli.Commandline} object. + */ protected void setSettingsLocation( InvocationRequest request, Commandline cli ) { File userSettingsFile = request.getUserSettingsFile(); @@ -171,6 +189,12 @@ protected void setSettingsLocation( InvocationRequest request, Commandline cli ) } + /** + *setToolchainsLocation.
+ * + * @param request a {@link org.apache.maven.shared.invoker.InvocationRequest} object. + * @param cli a {@link org.apache.maven.shared.utils.cli.Commandline} object. + */ protected void setToolchainsLocation( InvocationRequest request, Commandline cli ) { File toolchainsFile = request.getToolchainsFile(); @@ -192,6 +216,13 @@ protected void setToolchainsLocation( InvocationRequest request, Commandline cli } } + /** + *setShellEnvironment.
+ * + * @param request a {@link org.apache.maven.shared.invoker.InvocationRequest} object. + * @param cli a {@link org.apache.maven.shared.utils.cli.Commandline} object. + * @throws org.apache.maven.shared.invoker.CommandLineConfigurationException if any. + */ protected void setShellEnvironment( InvocationRequest request, Commandline cli ) throws CommandLineConfigurationException { @@ -232,6 +263,12 @@ protected void setShellEnvironment( InvocationRequest request, Commandline cli ) } } + /** + *setProfiles.
+ * + * @param request a {@link org.apache.maven.shared.invoker.InvocationRequest} object. + * @param cli a {@link org.apache.maven.shared.utils.cli.Commandline} object. + */ protected void setProfiles( InvocationRequest request, Commandline cli ) { ListsetGoals.
+ * + * @param request a {@link org.apache.maven.shared.invoker.InvocationRequest} object. + * @param cli a {@link org.apache.maven.shared.utils.cli.Commandline} object. + * @throws org.apache.maven.shared.invoker.CommandLineConfigurationException if any. + */ protected void setGoals( InvocationRequest request, Commandline cli ) throws CommandLineConfigurationException { ListsetProperties.
+ * + * @param request a {@link org.apache.maven.shared.invoker.InvocationRequest} object. + * @param cli a {@link org.apache.maven.shared.utils.cli.Commandline} object. + */ protected void setProperties( InvocationRequest request, Commandline cli ) { Properties properties = request.getProperties(); @@ -278,6 +328,12 @@ protected void setProperties( InvocationRequest request, Commandline cli ) } } + /** + *setPomLocation.
+ * + * @param request a {@link org.apache.maven.shared.invoker.InvocationRequest} object. + * @param cli a {@link org.apache.maven.shared.utils.cli.Commandline} object. + */ protected void setPomLocation( InvocationRequest request, Commandline cli ) { boolean pomSpecified = false; @@ -337,6 +393,12 @@ else if ( baseDirectory != null ) } } + /** + *setEnvironmentPaths.
+ * + * @param request a {@link org.apache.maven.shared.invoker.InvocationRequest} object. + * @param cli a {@link org.apache.maven.shared.utils.cli.Commandline} object. + */ protected void setEnvironmentPaths( InvocationRequest request, Commandline cli ) { File workingDirectory = request.getBaseDirectory(); @@ -403,6 +465,12 @@ else if ( workingDirectory.isFile() ) } } + /** + *setReactorBehavior.
+ * + * @param request a {@link org.apache.maven.shared.invoker.InvocationRequest} object. + * @param cli a {@link org.apache.maven.shared.utils.cli.Commandline} object. + */ protected void setReactorBehavior( InvocationRequest request, Commandline cli ) { // NOTE: The default is "fail-fast" @@ -445,6 +513,12 @@ else if ( ReactorFailureBehavior.FailNever.equals( failureBehavior ) ) } } + /** + *setFlags.
+ * + * @param request a {@link org.apache.maven.shared.invoker.InvocationRequest} object. + * @param cli a {@link org.apache.maven.shared.utils.cli.Commandline} object. + */ protected void setFlags( InvocationRequest request, Commandline cli ) { if ( request.isBatchMode() ) @@ -508,6 +582,12 @@ else if ( CheckSumPolicy.Warn.equals( checksumPolicy ) ) } } + /** + *setThreads.
+ * + * @param request a {@link org.apache.maven.shared.invoker.InvocationRequest} object. + * @param cli a {@link org.apache.maven.shared.utils.cli.Commandline} object. + */ protected void setThreads( InvocationRequest request, Commandline cli ) { String threads = request.getThreads(); @@ -519,6 +599,13 @@ protected void setThreads( InvocationRequest request, Commandline cli ) } + /** + *findMavenExecutable.
+ * + * @return a {@link java.io.File} object. + * @throws org.apache.maven.shared.invoker.CommandLineConfigurationException if any. + * @throws java.io.IOException if any. + */ protected File findMavenExecutable() throws CommandLineConfigurationException, IOException { @@ -606,41 +693,81 @@ private Properties getSystemEnvVars() return this.systemEnvVars; } + /** + *Getter for the field localRepositoryDirectory
.
Setter for the field localRepositoryDirectory
.
Getter for the field logger
.
Setter for the field logger
.
Getter for the field mavenHome
.
Setter for the field mavenHome
.
Getter for the field workingDirectory
.
Setter for the field workingDirectory
.
Getter for the field mavenExecutable
.
null
.
* @param cause The nested exception, may be null
.
*/
@@ -46,7 +45,7 @@ public MavenInvocationException( String message, Throwable cause )
/**
* Creates a new exception using the specified detail message.
- *
+ *
* @param message The detail message for this exception, may be null
.
*/
public MavenInvocationException( String message )
diff --git a/src/main/java/org/apache/maven/shared/invoker/PrintStreamHandler.java b/src/main/java/org/apache/maven/shared/invoker/PrintStreamHandler.java
index 39a8477..82c27a2 100644
--- a/src/main/java/org/apache/maven/shared/invoker/PrintStreamHandler.java
+++ b/src/main/java/org/apache/maven/shared/invoker/PrintStreamHandler.java
@@ -22,7 +22,7 @@
import java.io.PrintStream;
/**
- * Offers an output handler that writes to a print stream like {@link System#out}.
+ * Offers an output handler that writes to a print stream like {@link java.lang.System#out}.
*
* @since 2.0.9
*/
@@ -41,7 +41,7 @@ public class PrintStreamHandler
private boolean alwaysFlush;
/**
- * Creates a new output handler that writes to {@link System#out}.
+ * Creates a new output handler that writes to {@link java.lang.System#out}.
*/
public PrintStreamHandler()
{
@@ -50,7 +50,7 @@ public PrintStreamHandler()
/**
* Creates a new output handler that writes to the specified print stream.
- *
+ *
* @param out The print stream to write to, must not be null
.
* @param alwaysFlush A flag whether the print stream should be flushed after each line.
*/
@@ -64,6 +64,7 @@ public PrintStreamHandler( PrintStream out, boolean alwaysFlush )
this.alwaysFlush = alwaysFlush;
}
+ /** {@inheritDoc} */
public void consumeLine( String line )
{
if ( line == null )
diff --git a/src/main/java/org/apache/maven/shared/invoker/PrintStreamLogger.java b/src/main/java/org/apache/maven/shared/invoker/PrintStreamLogger.java
index 55bdb36..f0612ff 100644
--- a/src/main/java/org/apache/maven/shared/invoker/PrintStreamLogger.java
+++ b/src/main/java/org/apache/maven/shared/invoker/PrintStreamLogger.java
@@ -24,8 +24,8 @@
import java.io.StringWriter;
/**
- * Offers a logger that writes to a print stream like {@link System#out}.
- *
+ * Offers a logger that writes to a print stream like {@link java.lang.System#out}.
+ *
* @since 2.0.9
*/
public class PrintStreamLogger
@@ -43,7 +43,7 @@ public class PrintStreamLogger
private int threshold;
/**
- * Creates a new logger that writes to {@link System#out} and has a threshold of {@link #INFO}.
+ * Creates a new logger that writes to {@link java.lang.System#out} and has a threshold of {@link #INFO}.
*/
public PrintStreamLogger()
{
@@ -52,7 +52,7 @@ public PrintStreamLogger()
/**
* Creates a new logger that writes to the specified print stream.
- *
+ *
* @param out The print stream to write to, must not be null
.
* @param threshold The threshold for the logger.
*/
@@ -140,86 +140,127 @@ private void log( int level, String message, Throwable error )
out.println( buffer.toString() );
}
+ /** {@inheritDoc} */
public void debug( String message )
{
log( DEBUG, message, null );
}
+ /** {@inheritDoc} */
public void debug( String message, Throwable throwable )
{
log( DEBUG, message, throwable );
}
+ /** {@inheritDoc} */
public void info( String message )
{
log( INFO, message, null );
}
+ /** {@inheritDoc} */
public void info( String message, Throwable throwable )
{
log( INFO, message, throwable );
}
+ /** {@inheritDoc} */
public void warn( String message )
{
log( WARN, message, null );
}
+ /** {@inheritDoc} */
public void warn( String message, Throwable throwable )
{
log( WARN, message, throwable );
}
+ /** {@inheritDoc} */
public void error( String message )
{
log( ERROR, message, null );
}
+ /** {@inheritDoc} */
public void error( String message, Throwable throwable )
{
log( ERROR, message, throwable );
}
+ /** {@inheritDoc} */
public void fatalError( String message )
{
log( FATAL, message, null );
}
+ /** {@inheritDoc} */
public void fatalError( String message, Throwable throwable )
{
log( FATAL, message, throwable );
}
+ /**
+ * isDebugEnabled.
+ * + * @return a boolean. + */ public boolean isDebugEnabled() { return threshold >= DEBUG; } + /** + *isErrorEnabled.
+ * + * @return a boolean. + */ public boolean isErrorEnabled() { return threshold >= ERROR; } + /** + *isFatalErrorEnabled.
+ * + * @return a boolean. + */ public boolean isFatalErrorEnabled() { return threshold >= FATAL; } + /** + *isInfoEnabled.
+ * + * @return a boolean. + */ public boolean isInfoEnabled() { return threshold >= INFO; } + /** + *isWarnEnabled.
+ * + * @return a boolean. + */ public boolean isWarnEnabled() { return threshold >= WARN; } + /** + *Getter for the field threshold
.