dirs
could be an absolute or relative against the project's base
- * directory String
path.
+ * Method that removes the invalid directories in the specified directories. Note: All elements in
+ * dirs
could be an absolute or relative against the project's base directory String
path.
*
* @param project the current Maven project not null
* @param dirs the collection of String
directories path that will be validated.
@@ -145,8 +144,8 @@ public static Collectionfiles
should be an absolute String
path.
+ * Method that removes the invalid files in the specified files. Note: All elements in files
+ * should be an absolute String
path.
*
* @param files the list of String
files paths that will be validated.
* @return a List of valid File
objects.
@@ -161,13 +160,14 @@ protected static List'
). Intended for values
- * which may contain whitespaces.
- * '
). Intended for values which
+ * may contain whitespaces. \n
) are skipped.
*
* @param value the argument value.
@@ -240,8 +238,8 @@ protected static String quotedArgument( String value )
}
/**
- * Convenience method to format a path argument so that it is properly interpreted by the javadoc tool. Intended
- * for path values which may contain whitespaces.
+ * Convenience method to format a path argument so that it is properly interpreted by the javadoc tool. Intended for
+ * path values which may contain whitespaces.
*
* @param value the argument value.
* @return path argument with quote
@@ -277,8 +275,8 @@ protected static String quotedPathArgument( String value )
}
/**
- * Convenience method that copy all doc-files
directories from javadocDir
- * to the outputDirectory
.
+ * Convenience method that copy all doc-files
directories from javadocDir
to the
+ * outputDirectory
.
*
* @param outputDirectory the output directory
* @param javadocDir the javadoc directory
@@ -317,8 +315,8 @@ protected static void copyJavadocResources( File outputDirectory, File javadocDi
FileUtils.mkdir( docFileOutput.getAbsolutePath() );
FileUtils.copyDirectoryStructure( new File( javadocDir, docFile ), docFileOutput );
List- * javadoc.exe(or .sh) -J-version + * javadoc.exe( or.sh ) - J - version ** * @param javadocExe not null file @@ -553,44 +548,43 @@ else if ( StringUtils.isNotEmpty( out.getOutput() ) ) } /** - * Parse the output for 'javadoc -J-version' and return the javadoc version recognized. - *
JDK | - *Output for 'javadoc -J-version' | + *JDK | + *Output for 'javadoc -J-version' | *
---|---|---|---|
Sun 1.4 | - *java full version "1.4.2_12-b03" | + *Sun 1.4 | + *java full version "1.4.2_12-b03" | *
Sun 1.5 | - *java full version "1.5.0_07-164" | + *Sun 1.5 | + *java full version "1.5.0_07-164" | *
IBM 1.4 | - *javadoc full version "J2RE 1.4.2 IBM Windows 32 build cn1420-20040626" | + *IBM 1.4 | + *javadoc full version "J2RE 1.4.2 IBM Windows 32 build cn1420-20040626" | *
IBM 1.5 (French JVM) | - *javadoc version complète de "J2RE 1.5.0 IBM Windows 32 build pwi32pdev-20070426a" | + *IBM 1.5 (French JVM) | + *javadoc version complète de "J2RE 1.5.0 IBM Windows 32 build pwi32pdev-20070426a" | *
FreeBSD 1.5 | - *java full version "diablo-1.5.0-b01" | + *FreeBSD 1.5 | + *java full version "diablo-1.5.0-b01" | *
BEA jrockit 1.5 | - *java full version "1.5.0_11-b03" | + *BEA jrockit 1.5 | + *java full version "1.5.0_11-b03" | *
-Xms
or -Xmx
.
- * -Xms
or -Xmx
. JDK | - *Memory argument support for -Xms or -Xmx |
+ * JDK | + *Memory argument support for -Xms or -Xmx |
*
---|---|---|---|
SUN | - *1024k | 128m | 1g | 1t | + *SUN | + *1024k | 128m | 1g | 1t | *
IBM | - *1024k | 1024b | 128m | 128mb | 1g | 1gb | + *IBM | + *1024k | 1024b | 128m | 128mb | 1g | 1gb | *
BEA | - *1024k | 1024kb | 128m | 128mb | 1g | 1gb | + *BEA | + *1024k | 1024kb | 128m | 128mb | 1g | 1gb | *
memory
parameter,
- * the default unit is m
. The units g | gb
or t | tb
will be converted
- * in m
.
+ * @return the memory parsed with a supported unit. If no unit specified in the memory
parameter, the
+ * default unit is m
. The units g | gb
or t | tb
will be converted in
+ * m
.
* @throws IllegalArgumentException if the memory
parameter is null or doesn't match any pattern.
*/
protected static String parseJavadocMemory( String memory )
@@ -722,8 +715,8 @@ protected static boolean validateEncoding( String charsetName )
}
/**
- * For security reasons, if an active proxy is defined and needs an authentication by
- * username/password, hide the proxy password in the command line.
+ * For security reasons, if an active proxy is defined and needs an authentication by username/password, hide the
+ * proxy password in the command line.
*
* @param cmdLine a command line, not null
* @param settings the user settings
@@ -757,16 +750,15 @@ protected static String hideProxyPassword( String cmdLine, Settings settings )
}
/**
- * Auto-detect the class names of the implementation of com.sun.tools.doclets.Taglet
class from a
- * given jar file.
- * com.sun.tools.doclets.Taglet
class from a given
+ * jar file. JAVA_HOME/lib/tools.jar
is a requirement to find
* com.sun.tools.doclets.Taglet
class.
*
* @param jarFile not null
* @return the list of com.sun.tools.doclets.Taglet
class names from a given jarFile.
- * @throws IOException if jarFile is invalid or not found, or if the JAVA_HOME/lib/tools.jar
- * is not found.
+ * @throws IOException if jarFile is invalid or not found, or if the JAVA_HOME/lib/tools.jar
is not
+ * found.
* @throws ClassNotFoundException if any
* @throws NoClassDefFoundError if any
*/
@@ -790,8 +782,8 @@ protected static Listmaven.home
Java system property or defined in
* M2_HOME
system env variables.
*
@@ -906,9 +897,8 @@ protected static void invokeMaven( Log log, File localRepositoryDir, File projec
String mavenHome = getMavenHome( log );
if ( StringUtils.isEmpty( mavenHome ) )
{
- String msg =
- "Could NOT invoke Maven because no Maven Home is defined. You need to have set the M2_HOME "
- + "system env variable or a maven.home Java system properties.";
+ String msg = "Could NOT invoke Maven because no Maven Home is defined. You need to have set the M2_HOME "
+ + "system env variable or a maven.home Java system properties.";
if ( log != null )
{
log.error( msg );
@@ -958,9 +948,8 @@ protected static void invokeMaven( Log log, File localRepositoryDir, File projec
String invokerLogContent = readFile( invokerLog, "UTF-8" );
// see DefaultMaven
- if ( invokerLogContent != null
- && ( !invokerLogContent.contains( "Scanning for projects..." )
- || invokerLogContent.contains( OutOfMemoryError.class.getName() ) ) )
+ if ( invokerLogContent != null && ( !invokerLogContent.contains( "Scanning for projects..." )
+ || invokerLogContent.contains( OutOfMemoryError.class.getName() ) ) )
{
if ( log != null )
{
@@ -980,9 +969,8 @@ protected static void invokeMaven( Log log, File localRepositoryDir, File projec
String invokerLogContent = readFile( invokerLog, "UTF-8" );
// see DefaultMaven
- if ( invokerLogContent != null
- && ( !invokerLogContent.contains( "Scanning for projects..." )
- || invokerLogContent.contains( OutOfMemoryError.class.getName() ) ) )
+ if ( invokerLogContent != null && ( !invokerLogContent.contains( "Scanning for projects..." )
+ || invokerLogContent.contains( OutOfMemoryError.class.getName() ) ) )
{
throw new MavenInvocationException( ERROR_INIT_VM );
}
@@ -1014,8 +1002,8 @@ protected static String readFile( final File javaFile, final String encoding )
}
/**
- * Split the given path with colon and semi-colon, to support Solaris and Windows path.
- * Examples:
+ * Split the given path with colon and semi-colon, to support Solaris and Windows path. Examples:
+ *
* * splitPath( "/home:/tmp" ) = ["/home", "/tmp"] * splitPath( "/home;/tmp" ) = ["/home", "/tmp"] @@ -1023,8 +1011,8 @@ protected static String readFile( final File javaFile, final String encoding ) * splitPath( "C:/home;C:/tmp" ) = ["C:/home", "C:/tmp"] ** - * @param path which can contain multiple paths separated with a colon (
:
) or a
- * semi-colon (;
), platform independent. Could be null.
+ * @param path which can contain multiple paths separated with a colon (:
) or a semi-colon
+ * (;
), platform independent. Could be null.
* @return the path splitted by colon or semi-colon or null
if path was null
.
* @since 2.6.1
*/
@@ -1046,17 +1034,17 @@ protected static String[] splitPath( final String path )
}
/**
- * Unify the given path with the current System path separator, to be platform independent.
- * Examples:
+ * Unify the given path with the current System path separator, to be platform independent. Examples:
+ *
* * unifyPathSeparator( "/home:/tmp" ) = "/home:/tmp" (Solaris box) * unifyPathSeparator( "/home:/tmp" ) = "/home;/tmp" (Windows box) ** - * @param path which can contain multiple paths by separating them with a colon (
:
) or a
- * semi-colon (;
), platform independent. Could be null.
+ * @param path which can contain multiple paths by separating them with a colon (:
) or a semi-colon
+ * (;
), platform independent. Could be null.
* @return the same path but separated with the current System path separator or null
if path was
- * null
.
+ * null
.
* @since 2.6.1
* @see #splitPath(String)
* @see File#pathSeparator
@@ -1095,8 +1083,8 @@ private static Listmaven.home
system property or defined
- * in M2_HOME
system env variables or null if never set.
+ * @return the Maven home defined in the maven.home
system property or defined in M2_HOME
+ * system env variables or null if never set.
* @since 2.6
*/
private static String getMavenHome( Log log )
@@ -1238,9 +1226,8 @@ private static String getMavenHome( Log log )
{
if ( log != null && log.isErrorEnabled() )
{
- log
- .error( "Cannot find Maven application directory. Either specify \'maven.home\' system property, or "
- + "M2_HOME environment variable." );
+ log.error( "Cannot find Maven application directory. Either specify \'maven.home\' system property, or "
+ + "M2_HOME environment variable." );
}
}
@@ -1272,15 +1259,15 @@ private static String getMavenOpts( Log log )
/**
* @param log a logger could be null
- * @return the JAVA_HOME
from System.getProperty( "java.home" )
- * By default, System.getProperty( "java.home" ) = JRE_HOME
and JRE_HOME
- * should be in the JDK_HOME
+ * @return the JAVA_HOME
from System.getProperty( "java.home" ) By default,
+ * System.getProperty( "java.home" ) = JRE_HOME
and JRE_HOME
should be in the
+ * JDK_HOME
* @since 2.6
*/
private static File getJavaHome( Log log )
{
File javaHome = null;
-
+
String javaHomeValue = null;
try
{
@@ -1305,7 +1292,7 @@ private static File getJavaHome( Log log )
else
{
javaHome = new File( SystemUtils.getJavaHome(), ".." );
- }
+ }
}
if ( javaHome == null || !javaHome.exists() )
@@ -1349,14 +1336,11 @@ private static String getJavaOpts( Log log )
}
/**
- * A Path tokenizer takes a path and returns the components that make up
- * that path.
- *
- * The path can use path separators of either ':' or ';' and file separators
- * of either '/' or '\'.
+ * A Path tokenizer takes a path and returns the components that make up that path. The path can use path separators
+ * of either ':' or ';' and file separators of either '/' or '\'.
*
- * @version revision 439418 taken on 2009-09-12 from Ant Project
- * (see http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/ant/PathTokenizer.java)
+ * @version revision 439418 taken on 2009-09-12 from Ant Project (see
+ * http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/ant/PathTokenizer.java)
*/
private static class PathTokenizer
{
@@ -1366,21 +1350,18 @@ private static class PathTokenizer
private StringTokenizer tokenizer;
/**
- * A String which stores any path components which have been read ahead
- * due to DOS filesystem compensation.
+ * A String which stores any path components which have been read ahead due to DOS filesystem compensation.
*/
private String lookahead = null;
/**
- * A boolean that determines if we are running on Novell NetWare, which
- * exhibits slightly different path name characteristics (multi-character
- * volume / drive names)
+ * A boolean that determines if we are running on Novell NetWare, which exhibits slightly different path name
+ * characteristics (multi-character volume / drive names)
*/
private boolean onNetWare = Os.isFamily( "netware" );
/**
- * Flag to indicate whether or not we are running on a platform with a
- * DOS style filesystem
+ * Flag to indicate whether or not we are running on a platform with a DOS style filesystem
*/
private boolean dosStyleFilesystem;
@@ -1407,12 +1388,11 @@ private static class PathTokenizer
}
/**
- * Tests if there are more path elements available from this tokenizer's
- * path. If this method returns true
, then a subsequent call
- * to nextToken will successfully return a token.
+ * Tests if there are more path elements available from this tokenizer's path. If this method returns
+ * true
, then a subsequent call to nextToken will successfully return a token.
*
- * @return true
if and only if there is at least one token
- * in the string after the current position; false
otherwise.
+ * @return true
if and only if there is at least one token in the string after the current
+ * position; false
otherwise.
*/
public boolean hasMoreTokens()
{
@@ -1424,9 +1404,7 @@ public boolean hasMoreTokens()
* Returns the next path element from this tokenizer.
*
* @return the next path element from this tokenizer.
- *
- * @exception NoSuchElementException if there are no more elements in this
- * tokenizer's path.
+ * @exception NoSuchElementException if there are no more elements in this tokenizer's path.
*/
public String nextToken()
throws NoSuchElementException
@@ -1520,7 +1498,8 @@ public String nextToken()
* @author Robert Scholte
* @since 3.0.1
*/
- private static class JavadocOutputStreamConsumer extends CommandLineUtils.StringStreamConsumer
+ private static class JavadocOutputStreamConsumer
+ extends CommandLineUtils.StringStreamConsumer
{
@Override
public void consumeLine( String line )
@@ -1531,19 +1510,19 @@ public void consumeLine( String line )
}
}
}
-
+
static Listtrue
to validate the content of the package-list
resource;
- * false
to only check the existence of the package-list
resource.
- *
+ * false
to only check the existence of the package-list
resource.
* @return true
if url
points to a valid package-list
resource;
- * false
else.
- *
+ * false
else.
* @throws IOException if reading the resource fails.
- *
* @see #createHttpClient(org.apache.maven.settings.Settings, java.net.URL)
- *
* @since 2.8
*/
protected static boolean isValidPackageList( URL url, Settings settings, boolean validateContent )
@@ -1738,8 +1713,8 @@ protected static boolean isValidPackageList( URL url, Settings settings, boolean
int status = response.getStatusLine().getStatusCode();
if ( status != HttpStatus.SC_OK )
{
- throw new FileNotFoundException(
- "Unexpected HTTP status code " + status + " getting resource " + url.toExternalForm() + "." );
+ throw new FileNotFoundException( "Unexpected HTTP status code " + status + " getting resource "
+ + url.toExternalForm() + "." );
}
// Intentionally using the platform default encoding here since this is what Javadoc uses internally.
@@ -1822,9 +1797,7 @@ private static boolean isValidClassName( String str )
*
* @param settings The settings to use for setting up the client or {@code null}.
* @param url The {@code URL} to use for setting up the client or {@code null}.
- *
* @return A new {@code HttpClient} instance.
- *
* @see #DEFAULT_TIMEOUT
* @since 2.8
*/
@@ -1847,7 +1820,7 @@ private static HttpClient createHttpClient( Settings settings, URL url )
proxyInfo.setNonProxyHosts( activeProxy.getNonProxyHosts() );
if ( StringUtils.isNotEmpty( activeProxy.getHost() )
- && ( url == null || !ProxyUtils.validateNonProxyHosts( proxyInfo, url.getHost() ) ) )
+ && ( url == null || !ProxyUtils.validateNonProxyHosts( proxyInfo, url.getHost() ) ) )
{
HttpHost proxy = new HttpHost( activeProxy.getHost(), activeProxy.getPort() );
httpClient.getParams().setParameter( ConnRoutePNames.DEFAULT_PROXY, proxy );