From a83940bf89c5efdba50d00984582451ca144c6d6 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Wed, 3 Feb 2021 23:04:07 +0100 Subject: [PATCH] (doc) javadoc:fix --- .../CommandLineConfigurationException.java | 4 +- .../invoker/DefaultInvocationRequest.java | 204 +++++++++++++----- .../invoker/DefaultInvocationResult.java | 10 + .../maven/shared/invoker/DefaultInvoker.java | 37 +++- .../shared/invoker/InvocationRequest.java | 145 +++++++------ .../apache/maven/shared/invoker/Invoker.java | 30 +-- .../maven/shared/invoker/InvokerLogger.java | 38 ++-- .../invoker/MavenCommandLineBuilder.java | 136 +++++++++++- .../invoker/MavenInvocationException.java | 7 +- .../shared/invoker/PrintStreamHandler.java | 7 +- .../shared/invoker/PrintStreamLogger.java | 49 ++++- .../shared/invoker/SystemOutHandler.java | 4 +- .../maven/shared/invoker/SystemOutLogger.java | 2 +- 13 files changed, 503 insertions(+), 170 deletions(-) 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.

+ * + * @return a {@link java.util.List} object. + */ public List getGoals() { return goals; } + /** {@inheritDoc} */ public InputStream getInputStream( InputStream defaultStream ) { return inputStream == null ? defaultStream : inputStream; } + /** {@inheritDoc} */ public File getLocalRepositoryDirectory( File defaultDirectory ) { return localRepository == null ? defaultDirectory : localRepository; } + /** {@inheritDoc} */ public InvocationOutputHandler getOutputHandler( InvocationOutputHandler defaultHandler ) { return outputHandler == null ? defaultHandler : outputHandler; } + /** + *

Getter for the field pomFile.

+ * + * @return a {@link java.io.File} object. + */ public File getPomFile() { return pomFile; } + /** + *

Getter for the field properties.

+ * + * @return a {@link java.util.Properties} object. + */ public Properties getProperties() { return 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( List goals ) { this.goals = goals; return this; } + /** {@inheritDoc} */ public InvocationRequest setInputStream( InputStream inputStream ) { this.inputStream = inputStream; return this; } + /** {@inheritDoc} */ public InvocationRequest setBatchMode( boolean interactive ) { this.interactive = interactive; return this; } + /** {@inheritDoc} */ public InvocationRequest setLocalRepositoryDirectory( File localRepository ) { this.localRepository = localRepository; return this; } + /** {@inheritDoc} */ public InvocationRequest setOffline( boolean offline ) { this.offline = offline; return this; } + /** {@inheritDoc} */ public InvocationRequest setOutputHandler( InvocationOutputHandler outputHandler ) { this.outputHandler = outputHandler; return this; } + /** {@inheritDoc} */ public InvocationRequest setPomFile( File pomFile ) { this.pomFile = pomFile; return this; } + /** {@inheritDoc} */ public InvocationRequest setProperties( Properties properties ) { this.properties = properties; return this; } + /** {@inheritDoc} */ public InvocationRequest setShowErrors( boolean showErrors ) { this.showErrors = showErrors; return this; } + /** {@inheritDoc} */ public InvocationRequest setUpdateSnapshots( boolean updateSnapshots ) { this.updateSnapshots = updateSnapshots; @@ -278,27 +358,34 @@ public InvocationRequest setUpdateSnapshots( boolean updateSnapshots ) } /** + *

isShellEnvironmentInherited.

+ * * @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.

+ * + * @return a {@link java.io.File} object. + */ public File getJavaHome() { return javaHome; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public InvocationRequest setJavaHome( File javaHome ) { this.javaHome = javaHome; @@ -307,15 +394,15 @@ public InvocationRequest setJavaHome( File javaHome ) /** * {@inheritDoc} + * + * @return a {@link java.io.File} object. */ public File getUserSettingsFile() { return userSettings; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public InvocationRequest setUserSettingsFile( File userSettings ) { this.userSettings = userSettings; @@ -324,15 +411,15 @@ public InvocationRequest setUserSettingsFile( File userSettings ) /** * {@inheritDoc} + * + * @return a {@link java.io.File} object. */ public File getGlobalSettingsFile() { return globalSettings; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public InvocationRequest setGlobalSettingsFile( File globalSettings ) { this.globalSettings = globalSettings; @@ -341,15 +428,15 @@ public InvocationRequest setGlobalSettingsFile( File globalSettings ) /** * {@inheritDoc} + * + * @return a {@link java.io.File} object. */ public File getToolchainsFile() { return toolchains; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public InvocationRequest setToolchainsFile( File toolchains ) { this.toolchains = toolchains; @@ -358,15 +445,15 @@ public InvocationRequest setToolchainsFile( File toolchains ) /** * {@inheritDoc} + * + * @return a {@link java.io.File} object. */ public File getGlobalToolchainsFile() { return globalToolchains; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public InvocationRequest setGlobalToolchainsFile( File toolchains ) { this.globalToolchains = toolchains; @@ -376,6 +463,8 @@ public InvocationRequest setGlobalToolchainsFile( File toolchains ) /** * {@inheritDoc} + * + * @return a CheckSumPolicy object. */ public CheckSumPolicy getGlobalChecksumPolicy() { @@ -384,6 +473,9 @@ public CheckSumPolicy getGlobalChecksumPolicy() /** * {@inheritDoc} + * + * @param globalChecksumPolicy a CheckSumPolicy object. + * @return a {@link org.apache.maven.shared.invoker.InvocationRequest} object. */ public InvocationRequest setGlobalChecksumPolicy( CheckSumPolicy globalChecksumPolicy ) { @@ -393,15 +485,15 @@ public InvocationRequest setGlobalChecksumPolicy( CheckSumPolicy globalChecksumP /** * {@inheritDoc} + * + * @return a {@link java.lang.String} object. */ public String getPomFileName() { return pomFilename; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public InvocationRequest setPomFileName( String pomFilename ) { this.pomFilename = pomFilename; @@ -410,15 +502,15 @@ public InvocationRequest setPomFileName( String pomFilename ) /** * {@inheritDoc} + * + * @return a {@link java.util.List} object. */ public List getProfiles() { return profiles; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public InvocationRequest setProfiles( List profiles ) { this.profiles = profiles; @@ -427,21 +519,22 @@ public InvocationRequest setProfiles( List profiles ) /** * {@inheritDoc} + * + * @return a boolean. */ public boolean isNonPluginUpdates() { return nonPluginUpdates; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public InvocationRequest setNonPluginUpdates( boolean nonPluginUpdates ) { this.nonPluginUpdates = nonPluginUpdates; return this; } + /** {@inheritDoc} */ public InvocationRequest addShellEnvironment( String name, String value ) { if ( this.shellEnvironments == null ) @@ -452,16 +545,27 @@ public InvocationRequest addShellEnvironment( String name, String value ) return this; } + /** + *

Getter for the field shellEnvironments.

+ * + * @return a {@link java.util.Map} object. + */ public Map getShellEnvironments() { return shellEnvironments == null ? Collections.emptyMap() : shellEnvironments; } + /** + *

Getter for the field mavenOpts.

+ * + * @return a {@link java.lang.String} object. + */ public String getMavenOpts() { return mavenOpts; } + /** {@inheritDoc} */ public InvocationRequest setMavenOpts( String mavenOpts ) { this.mavenOpts = mavenOpts; @@ -469,16 +573,17 @@ public InvocationRequest setMavenOpts( String 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 List getProjects() { return projects; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public InvocationRequest setProjects( List projects ) { this.projects = projects; @@ -521,15 +626,15 @@ public InvocationRequest setProjects( List projects ) /** * {@inheritDoc} + * + * @return a boolean. */ public boolean isAlsoMake() { return alsoMake; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public InvocationRequest setAlsoMake( boolean alsoMake ) { this.alsoMake = alsoMake; @@ -538,15 +643,15 @@ public InvocationRequest setAlsoMake( boolean alsoMake ) /** * {@inheritDoc} + * + * @return a boolean. */ public boolean isAlsoMakeDependents() { return alsoMakeDependents; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public InvocationRequest setAlsoMakeDependents( boolean alsoMakeDependents ) { this.alsoMakeDependents = alsoMakeDependents; @@ -555,24 +660,22 @@ public InvocationRequest setAlsoMakeDependents( boolean alsoMakeDependents ) /** * {@inheritDoc} + * + * @return a {@link java.lang.String} object. */ public String getResumeFrom() { return resumeFrom; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public InvocationRequest setResumeFrom( String resumeFrom ) { this.resumeFrom = resumeFrom; return this; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public InvocationRequest setBuilder( String id ) { this.builderId = id; @@ -581,6 +684,8 @@ public InvocationRequest setBuilder( String id ) /** * {@inheritDoc} + * + * @return a {@link java.lang.String} object. */ public String getBuilder() { @@ -588,12 +693,14 @@ public String getBuilder() } + /** {@inheritDoc} */ @Override public int getTimeoutInSeconds() { return timeoutInSeconds; } + /** {@inheritDoc} */ @Override public void setTimeoutInSeconds( int timeoutInSeconds ) { @@ -602,15 +709,16 @@ public void setTimeoutInSeconds( int timeoutInSeconds ) /** * {@inheritDoc} + * + * @return a boolean. + * @since 3.1.0 */ public boolean isQuiet() { return quiet; } - /** - * {@inheritDoc} - */ + /** {@inheritDoc} */ public InvocationRequest setQuiet( boolean quiet ) { this.quiet = quiet; diff --git a/src/main/java/org/apache/maven/shared/invoker/DefaultInvocationResult.java b/src/main/java/org/apache/maven/shared/invoker/DefaultInvocationResult.java index bc36869..13fbdc2 100644 --- a/src/main/java/org/apache/maven/shared/invoker/DefaultInvocationResult.java +++ b/src/main/java/org/apache/maven/shared/invoker/DefaultInvocationResult.java @@ -48,11 +48,21 @@ public final class DefaultInvocationResult // hide constructor } + /** + *

Getter for the field exitCode.

+ * + * @return a int. + */ public int getExitCode() { return exitCode; } + /** + *

Getter for the field executionException.

+ * + * @return a {@link org.apache.maven.shared.utils.cli.CommandLineException} object. + */ public CommandLineException getExecutionException() { return executionException; diff --git a/src/main/java/org/apache/maven/shared/invoker/DefaultInvoker.java b/src/main/java/org/apache/maven/shared/invoker/DefaultInvoker.java index 0dd77da..6fa6ca8 100644 --- a/src/main/java/org/apache/maven/shared/invoker/DefaultInvoker.java +++ b/src/main/java/org/apache/maven/shared/invoker/DefaultInvoker.java @@ -31,7 +31,7 @@ /** * Class intended to be used by clients who wish to invoke a forked Maven process from their applications - * + * * @author jdcasey */ @Named @@ -39,6 +39,7 @@ public class DefaultInvoker implements Invoker { + /** Constant 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.

+ * + * @return a {@link java.io.File} object. + */ public File getLocalRepositoryDirectory() { return localRepositoryDirectory; } + /** + *

Getter for the field logger.

+ * + * @return a {@link org.apache.maven.shared.invoker.InvokerLogger} object. + */ public InvokerLogger getLogger() { return logger; } + /** {@inheritDoc} */ public Invoker setLocalRepositoryDirectory( File localRepositoryDirectory ) { this.localRepositoryDirectory = localRepositoryDirectory; return this; } + /** {@inheritDoc} */ public Invoker setLogger( InvokerLogger logger ) { this.logger = ( logger != null ) ? logger : DEFAULT_LOGGER; return this; } + /** + *

Getter for the field workingDirectory.

+ * + * @return a {@link java.io.File} object. + */ public File getWorkingDirectory() { return workingDirectory; } + /** {@inheritDoc} */ public Invoker setWorkingDirectory( File workingDirectory ) { this.workingDirectory = workingDirectory; return this; } + /** + *

Getter for the field mavenHome.

+ * + * @return a {@link java.io.File} object. + */ public File getMavenHome() { return mavenHome; } + /** {@inheritDoc} */ public Invoker setMavenHome( File mavenHome ) { this.mavenHome = mavenHome; @@ -209,29 +235,38 @@ public Invoker setMavenHome( File mavenHome ) return this; } + /** + *

Getter for the field mavenExecutable.

+ * + * @return a {@link java.io.File} object. + */ public File getMavenExecutable() { return mavenExecutable; } + /** {@inheritDoc} */ public Invoker setMavenExecutable( File mavenExecutable ) { this.mavenExecutable = mavenExecutable; return this; } + /** {@inheritDoc} */ public Invoker setErrorHandler( InvocationOutputHandler errorHandler ) { this.errorHandler = errorHandler; return this; } + /** {@inheritDoc} */ public Invoker setInputStream( InputStream inputStream ) { this.inputStream = inputStream; return this; } + /** {@inheritDoc} */ public Invoker setOutputHandler( InvocationOutputHandler outputHandler ) { this.outputHandler = outputHandler; diff --git a/src/main/java/org/apache/maven/shared/invoker/InvocationRequest.java b/src/main/java/org/apache/maven/shared/invoker/InvocationRequest.java index 0599b5f..d65af9a 100644 --- a/src/main/java/org/apache/maven/shared/invoker/InvocationRequest.java +++ b/src/main/java/org/apache/maven/shared/invoker/InvocationRequest.java @@ -34,7 +34,7 @@ public interface InvocationRequest /** * By default, Maven is executed in batch mode. This mean no interaction with the Maven process can be done. - * + * * @return 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. */ List getGoals(); /** * Gets the path to the user settings for the Maven invocation. - * + * * @return The path to the user settings for the Maven invocation or null 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. */ List getProfiles(); /** * Gets the environment variables for the Maven invocation. - * + * * @return The environment variables for the Maven invocation or null if not set. */ Map getShellEnvironments(); /** * Gets the value of the MAVEN_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 nonPluginUpdates true 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 quiet true 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 be null. * @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 ) { List profiles = request.getProfiles(); @@ -244,6 +281,13 @@ protected void setProfiles( InvocationRequest request, Commandline cli ) } + /** + *

setGoals.

+ * + * @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 { List goals = request.getGoals(); @@ -261,6 +305,12 @@ protected void setGoals( InvocationRequest request, Commandline cli ) throws Com } } + /** + *

setProperties.

+ * + * @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.

+ * + * @return a {@link java.io.File} object. + */ public File getLocalRepositoryDirectory() { return localRepositoryDirectory; } + /** + *

Setter for the field localRepositoryDirectory.

+ * + * @param localRepositoryDirectory a {@link java.io.File} object. + */ public void setLocalRepositoryDirectory( File localRepositoryDirectory ) { this.localRepositoryDirectory = localRepositoryDirectory; } + /** + *

Getter for the field logger.

+ * + * @return a {@link org.apache.maven.shared.invoker.InvokerLogger} object. + */ public InvokerLogger getLogger() { return logger; } + /** + *

Setter for the field logger.

+ * + * @param logger a {@link org.apache.maven.shared.invoker.InvokerLogger} object. + */ public void setLogger( InvokerLogger logger ) { this.logger = logger; } + /** + *

Getter for the field mavenHome.

+ * + * @return a {@link java.io.File} object. + */ public File getMavenHome() { return mavenHome; } + /** + *

Setter for the field mavenHome.

+ * + * @param mavenHome a {@link java.io.File} object. + */ public void setMavenHome( File mavenHome ) { this.mavenHome = mavenHome; } + /** + *

Getter for the field workingDirectory.

+ * + * @return a {@link java.io.File} object. + */ public File getWorkingDirectory() { return workingDirectory; } + /** + *

Setter for the field workingDirectory.

+ * + * @param workingDirectory a {@link java.io.File} object. + */ public void setWorkingDirectory( File workingDirectory ) { this.workingDirectory = workingDirectory; @@ -648,7 +775,7 @@ public void setWorkingDirectory( File workingDirectory ) /** * {@code mavenExecutable} can either be relative to ${maven.home}/bin/ or absolute - * + * * @param mavenExecutable the executable */ public void setMavenExecutable( File mavenExecutable ) @@ -656,6 +783,11 @@ public void setMavenExecutable( File mavenExecutable ) this.mavenExecutable = mavenExecutable; } + /** + *

Getter for the field mavenExecutable.

+ * + * @return a {@link java.io.File} object. + */ public File getMavenExecutable() { return mavenExecutable; diff --git a/src/main/java/org/apache/maven/shared/invoker/MavenInvocationException.java b/src/main/java/org/apache/maven/shared/invoker/MavenInvocationException.java index e1a0b5f..a5e1d13 100644 --- a/src/main/java/org/apache/maven/shared/invoker/MavenInvocationException.java +++ b/src/main/java/org/apache/maven/shared/invoker/MavenInvocationException.java @@ -23,9 +23,8 @@ * Signals an error during the construction of the command line used to invoke Maven, e.g. illegal invocation arguments. * This should not be confused with a failure of the invoked Maven build itself which will be reported by means of a * non-zero exit code. - * - * @see InvocationResult#getExitCode() * + * @see InvocationResult#getExitCode() */ public class MavenInvocationException extends Exception @@ -35,7 +34,7 @@ public class MavenInvocationException /** * 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. */ @@ -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.

+ * + * @return a int. + */ public int getThreshold() { return threshold; } + /** {@inheritDoc} */ public void setThreshold( int threshold ) { this.threshold = threshold; diff --git a/src/main/java/org/apache/maven/shared/invoker/SystemOutHandler.java b/src/main/java/org/apache/maven/shared/invoker/SystemOutHandler.java index 9ce6ef9..94bfb4d 100644 --- a/src/main/java/org/apache/maven/shared/invoker/SystemOutHandler.java +++ b/src/main/java/org/apache/maven/shared/invoker/SystemOutHandler.java @@ -20,7 +20,7 @@ */ /** - * Offers an output handler that writes to {@link System#out}. + * Offers an output handler that writes to {@link java.lang.System#out}. * */ public class SystemOutHandler @@ -37,7 +37,7 @@ public SystemOutHandler() /** * Creates a new output handler. - * + * * @param alwaysFlush A flag whether the print stream should be flushed after each line. */ public SystemOutHandler( boolean alwaysFlush ) diff --git a/src/main/java/org/apache/maven/shared/invoker/SystemOutLogger.java b/src/main/java/org/apache/maven/shared/invoker/SystemOutLogger.java index 8359757..f8be91c 100644 --- a/src/main/java/org/apache/maven/shared/invoker/SystemOutLogger.java +++ b/src/main/java/org/apache/maven/shared/invoker/SystemOutLogger.java @@ -20,7 +20,7 @@ */ /** - * Offers a logger that writes to {@link System#out}. + * Offers a logger that writes to {@link java.lang.System#out}. * */ public class SystemOutLogger