parameters = findNamedChild( parametersNode, "parameter" );
+ append( sb, "Available parameters:", 1 );
+ append( sb, "", 0 );
+
+ for ( Node parameter : parameters )
+ {
+ writeParameter( sb, parameter, configurationElement );
+ }
+ }
+ }
+ }
+
+ private void writeParameter( StringBuilder sb, Node parameter, Node configurationElement )
+ throws MojoExecutionException
+ {
+ String parameterName = getValue( parameter, "name" );
+ String parameterDescription = getValue( parameter, "description" );
+
+ Element fieldConfigurationElement = null;
+ if ( configurationElement != null )
+ {
+ fieldConfigurationElement = (Element) findSingleChild( configurationElement, parameterName );
+ }
+
+ String parameterDefaultValue = "";
+ if ( fieldConfigurationElement != null && fieldConfigurationElement.hasAttribute( "default-value" ) )
+ {
+ parameterDefaultValue = " (Default: " + fieldConfigurationElement.getAttribute( "default-value" ) + ")";
+ }
+ append( sb, parameterName + parameterDefaultValue, 2 );
+ Node deprecated = findSingleChild( parameter, "deprecated" );
+ if ( ( deprecated != null ) && isNotEmpty( deprecated.getTextContent() ) )
+ {
+ append( sb, "Deprecated. " + deprecated.getTextContent(), 3 );
+ append( sb, "", 0 );
+ }
+ append( sb, parameterDescription, 3 );
+ if ( "true".equals( getValue( parameter, "required" ) ) )
+ {
+ append( sb, "Required: Yes", 3 );
+ }
+ if ( ( fieldConfigurationElement != null ) && isNotEmpty( fieldConfigurationElement.getTextContent() ) )
+ {
+ String property = getPropertyFromExpression( fieldConfigurationElement.getTextContent() );
+ append( sb, "User property: " + property, 3 );
+ }
+
+ append( sb, "", 0 );
+ }
+
+ /**
+ * Repeat a String n
times to form a new string.
+ *
+ * @param str String to repeat
+ * @param repeat number of times to repeat str
+ * @return String with repeated String
+ * @throws NegativeArraySizeException if repeat < 0
+ * @throws NullPointerException if str is null
+ */
+ private static String repeat( String str, int repeat )
+ {
+ StringBuilder buffer = new StringBuilder( repeat * str.length() );
+
+ for ( int i = 0; i < repeat; i++ )
+ {
+ buffer.append( str );
+ }
+
+ return buffer.toString();
+ }
+
+ /**
+ * Append a description to the buffer by respecting the indentSize and lineLength parameters.
+ * Note: The last character is always a new line.
+ *
+ * @param sb The buffer to append the description, not null
.
+ * @param description The description, not null
.
+ * @param indent The base indentation level of each line, must not be negative.
+ */
+ private void append( StringBuilder sb, String description, int indent )
+ {
+ for ( String line : toLines( description, indent, indentSize, lineLength ) )
+ {
+ sb.append( line ).append( '\n' );
+ }
+ }
+
+ /**
+ * Splits the specified text into lines of convenient display length.
+ *
+ * @param text The text to split into lines, must not be null
.
+ * @param indent The base indentation level of each line, must not be negative.
+ * @param indentSize The size of each indentation, must not be negative.
+ * @param lineLength The length of the line, must not be negative.
+ * @return The sequence of display lines, never null
.
+ * @throws NegativeArraySizeException if indent < 0
+ */
+ private static List toLines( String text, int indent, int indentSize, int lineLength )
+ {
+ List lines = new ArrayList();
+
+ String ind = repeat( "\t", indent );
+
+ String[] plainLines = text.split( "(\r\n)|(\r)|(\n)" );
+
+ for ( String plainLine : plainLines )
+ {
+ toLines( lines, ind + plainLine, indentSize, lineLength );
+ }
+
+ return lines;
+ }
+
+ /**
+ * Adds the specified line to the output sequence, performing line wrapping if necessary.
+ *
+ * @param lines The sequence of display lines, must not be null
.
+ * @param line The line to add, must not be null
.
+ * @param indentSize The size of each indentation, must not be negative.
+ * @param lineLength The length of the line, must not be negative.
+ */
+ private static void toLines( List lines, String line, int indentSize, int lineLength )
+ {
+ int lineIndent = getIndentLevel( line );
+ StringBuilder buf = new StringBuilder( 256 );
+
+ String[] tokens = line.split( " +" );
+
+ for ( String token : tokens )
+ {
+ if ( buf.length() > 0 )
+ {
+ if ( buf.length() + token.length() >= lineLength )
+ {
+ lines.add( buf.toString() );
+ buf.setLength( 0 );
+ buf.append( repeat( " ", lineIndent * indentSize ) );
+ }
+ else
+ {
+ buf.append( ' ' );
+ }
+ }
+
+ for ( int j = 0; j < token.length(); j++ )
+ {
+ char c = token.charAt( j );
+ if ( c == '\t' )
+ {
+ buf.append( repeat( " ", indentSize - buf.length() % indentSize ) );
+ }
+ else if ( c == '\u00A0' )
+ {
+ buf.append( ' ' );
+ }
+ else
+ {
+ buf.append( c );
+ }
+ }
+ }
+ lines.add( buf.toString() );
+ }
+
+ /**
+ * Gets the indentation level of the specified line.
+ *
+ * @param line The line whose indentation level should be retrieved, must not be null
.
+ * @return The indentation level of the line.
+ */
+ private static int getIndentLevel( String line )
+ {
+ int level = 0;
+ for ( int i = 0; i < line.length() && line.charAt( i ) == '\t'; i++ )
+ {
+ level++;
+ }
+ for ( int i = level + 1; i <= level + 4 && i < line.length(); i++ )
+ {
+ if ( line.charAt( i ) == '\t' )
+ {
+ level++;
+ break;
+ }
+ }
+ return level;
+ }
+
+ private String getPropertyFromExpression( String expression )
+ {
+ if ( expression != null && expression.startsWith( "${" ) && expression.endsWith( "}" )
+ && !expression.substring( 2 ).contains( "${" ) )
+ {
+ // expression="${xxx}" -> property="xxx"
+ return expression.substring( 2, expression.length() - 1 );
+ }
+ // no property can be extracted
+ return null;
+ }
+}
--- surefire-2.22.0/maven-surefire-plugin/src/main/filtered-resources/META-INF/maven/org.apache.maven.plugins/maven-surefire-plugin/plugin-help.xml 1970-01-01 01:00:00.000000000 +0100
+++ surefire-2.22.0/maven-surefire-plugin/src/main/filtered-resources/META-INF/maven/org.apache.maven.plugins/maven-surefire-plugin/plugin-help.xml 2019-04-01 16:35:39.493479592 +0200
@@ -0,0 +1,686 @@
+
+
+ ${project.name}
+ ${project.description}
+ ${project.groupId}
+ ${project.artifactId}
+ ${project.version}
+ surefire
+
+
+ help
+ Display help information on maven-surefire-plugin.
+Call mvn surefire:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
+ false
+ false
+ false
+ false
+ false
+ true
+ org.apache.maven.plugin.surefire.HelpMojo
+ java
+ per-lookup
+ once-per-session
+ true
+
+
+ detail
+ boolean
+ false
+ true
+ Display help information on maven-surefire-plugin.
+Call mvn surefire:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
+
+
+ goal
+ java.lang.String
+ false
+ true
+ Display help information on maven-surefire-plugin.
+Call mvn surefire:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
+
+
+ indentSize
+ int
+ false
+ true
+ Display help information on maven-surefire-plugin.
+Call mvn surefire:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
+
+
+ lineLength
+ int
+ false
+ true
+ Display help information on maven-surefire-plugin.
+Call mvn surefire:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
+
+
+
+ ${detail}
+ ${goal}
+ ${indentSize}
+ ${lineLength}
+
+
+
+ test
+ Run tests using Surefire.
+ test
+ false
+ true
+ false
+ false
+ false
+ true
+ test
+ org.apache.maven.plugin.surefire.SurefirePlugin
+ java
+ per-lookup
+ once-per-session
+ true
+
+
+ additionalClasspathElements
+ java.lang.String[]
+ 2.4
+ false
+ true
+ Run tests using Surefire.
+
+
+ argLine
+ java.lang.String
+ 2.1
+ false
+ true
+ Run tests using Surefire.
+
+
+ basedir
+ java.io.File
+ false
+ true
+ Run tests using Surefire.
+
+
+ childDelegation
+ boolean
+ 2.1
+ false
+ true
+ Run tests using Surefire.
+
+
+ classesDirectory
+ java.io.File
+ false
+ true
+ Run tests using Surefire.
+
+
+ classpathDependencyExcludes
+ java.lang.String[]
+ 2.6
+ false
+ true
+ Run tests using Surefire.
+
+
+ classpathDependencyScopeExclude
+ java.lang.String
+ 2.6
+ false
+ true
+ Run tests using Surefire.
+
+
+ debugForkedProcess
+ java.lang.String
+ 2.4
+ false
+ true
+ Run tests using Surefire.
+
+
+ dependenciesToScan
+ java.lang.String[]
+ 2.15
+ false
+ true
+ Run tests using Surefire.
+
+
+ disableXmlReport
+ boolean
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ enableAssertions
+ boolean
+ 2.3.1
+ false
+ true
+ Run tests using Surefire.
+
+
+ encoding
+ java.lang.String
+ 3.0.0-M1
+ false
+ true
+ Run tests using Surefire.
+
+
+ environmentVariables
+ java.util.Map
+ 2.1.3
+ false
+ true
+ Run tests using Surefire.
+
+
+ excludedGroups
+ java.lang.String
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ excludes
+ java.util.List
+ false
+ true
+ Run tests using Surefire.
+
+
+ excludesFile
+ java.io.File
+ false
+ true
+ Run tests using Surefire.
+
+
+ failIfNoSpecifiedTests
+ java.lang.Boolean
+ 2.12
+ false
+ true
+ Run tests using Surefire.
+
+
+ failIfNoTests
+ java.lang.Boolean
+ 2.4
+ false
+ true
+ Run tests using Surefire.
+
+
+ forkCount
+ java.lang.String
+ 2.14
+ false
+ true
+ Run tests using Surefire.
+
+
+ forkedProcessExitTimeoutInSeconds
+ int
+ 2.20
+ false
+ true
+ Run tests using Surefire.
+
+
+ forkedProcessTimeoutInSeconds
+ int
+ 2.4
+ false
+ true
+ Run tests using Surefire.
+
+
+ forkMode
+ java.lang.String
+ 2.1
+ false
+ true
+ Run tests using Surefire.
+
+
+ groups
+ java.lang.String
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ includes
+ java.util.List
+ false
+ true
+ Run tests using Surefire.
+
+
+ includesFile
+ java.io.File
+ false
+ true
+ Run tests using Surefire.
+
+
+ junitArtifactName
+ java.lang.String
+ 2.3.1
+ false
+ true
+ Run tests using Surefire.
+
+
+ junitPlatformArtifactName
+ java.lang.String
+ 2.22.0
+ false
+ true
+ Run tests using Surefire.
+
+
+ jvm
+ java.lang.String
+ 2.1
+ false
+ true
+ Run tests using Surefire.
+
+
+ objectFactory
+ java.lang.String
+ 2.5
+ false
+ true
+ Run tests using Surefire.
+
+
+ parallel
+ java.lang.String
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ parallelOptimized
+ boolean
+ 2.17
+ false
+ true
+ Run tests using Surefire.
+
+
+ parallelTestsTimeoutForcedInSeconds
+ double
+ 2.16
+ false
+ true
+ Run tests using Surefire.
+
+
+ parallelTestsTimeoutInSeconds
+ double
+ 2.16
+ false
+ true
+ Run tests using Surefire.
+
+
+ perCoreThreadCount
+ boolean
+ 2.5
+ false
+ true
+ Run tests using Surefire.
+
+
+ printSummary
+ boolean
+ false
+ true
+ Run tests using Surefire.
+
+
+ properties
+ java.util.Properties
+ 2.4
+ false
+ true
+ Run tests using Surefire.
+
+
+ redirectTestOutputToFile
+ boolean
+ 2.3
+ false
+ true
+ Run tests using Surefire.
+
+
+ remoteRepositories
+ java.util.List
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ reportFormat
+ java.lang.String
+ false
+ true
+ Run tests using Surefire.
+
+
+ reportNameSuffix
+ java.lang.String
+ false
+ true
+ Run tests using Surefire.
+
+
+ reportsDirectory
+ java.io.File
+ false
+ true
+ Run tests using Surefire.
+
+
+ rerunFailingTestsCount
+ int
+ false
+ true
+ Run tests using Surefire.
+
+
+ reuseForks
+ boolean
+ 2.13
+ false
+ true
+ Run tests using Surefire.
+
+
+ runOrder
+ java.lang.String
+ 2.7
+ false
+ true
+ Run tests using Surefire.
+
+
+ shutdown
+ java.lang.String
+ 2.19
+ false
+ true
+ Run tests using Surefire.
+
+
+ skip
+ boolean
+ false
+ true
+ Run tests using Surefire.
+
+
+ skipAfterFailureCount
+ int
+ 2.19
+ false
+ true
+ Run tests using Surefire.
+
+
+ skipExec
+ boolean
+ 2.3
+ Use skipTests instead.
+ false
+ true
+ Run tests using Surefire.
+
+
+ skipTests
+ boolean
+ 2.4
+ false
+ true
+ Run tests using Surefire.
+
+
+ suiteXmlFiles
+ java.io.File[]
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ systemProperties
+ java.util.Properties
+ Use systemPropertyVariables instead.
+ false
+ true
+ Run tests using Surefire.
+
+
+ systemPropertiesFile
+ java.io.File
+ 2.8.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ systemPropertyVariables
+ java.util.Map
+ 2.5
+ false
+ true
+ Run tests using Surefire.
+
+
+ tempDir
+ java.lang.String
+ 2.20
+ false
+ true
+ Run tests using Surefire.
+
+
+ test
+ java.lang.String
+ false
+ true
+ Run tests using Surefire.
+
+
+ testClassesDirectory
+ java.io.File
+ false
+ true
+ Run tests using Surefire.
+
+
+ testFailureIgnore
+ boolean
+ false
+ true
+ Run tests using Surefire.
+
+
+ testNGArtifactName
+ java.lang.String
+ 2.3.1
+ false
+ true
+ Run tests using Surefire.
+
+
+ testSourceDirectory
+ java.io.File
+ 2.2
+ true
+ true
+ Run tests using Surefire.
+
+
+ threadCount
+ int
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ threadCountClasses
+ int
+ 2.16
+ false
+ true
+ Run tests using Surefire.
+
+
+ threadCountMethods
+ int
+ 2.16
+ false
+ true
+ Run tests using Surefire.
+
+
+ threadCountSuites
+ int
+ 2.16
+ false
+ true
+ Run tests using Surefire.
+
+
+ trimStackTrace
+ boolean
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ useFile
+ boolean
+ false
+ true
+ Run tests using Surefire.
+
+
+ useManifestOnlyJar
+ boolean
+ 2.4.3
+ false
+ true
+ Run tests using Surefire.
+
+
+ useSystemClassLoader
+ boolean
+ 2.3
+ false
+ true
+ Run tests using Surefire.
+
+
+ useUnlimitedThreads
+ boolean
+ 2.5
+ false
+ true
+ Run tests using Surefire.
+
+
+ workingDirectory
+ java.io.File
+ 2.1.3
+ false
+ true
+ Run tests using Surefire.
+
+
+
+ ${maven.test.additionalClasspath}
+ ${argLine}
+
+ ${childDelegation}
+
+ ${maven.test.dependency.excludes}
+ ${maven.surefire.debug}
+ ${dependenciesToScan}
+ ${disableXmlReport}
+ ${enableAssertions}
+ ${surefire.encoding}
+ ${excludedGroups}
+ ${surefire.excludesFile}
+ ${surefire.failIfNoSpecifiedTests}
+ ${failIfNoTests}
+ ${forkCount}
+ ${surefire.exitTimeout}
+ ${surefire.timeout}
+ ${forkMode}
+ ${groups}
+ ${surefire.includesFile}
+ ${junitArtifactName}
+ ${junitPlatformArtifactName}
+ ${jvm}
+ ${objectFactory}
+ ${parallel}
+ ${parallelOptimized}
+ ${surefire.parallel.forcedTimeout}
+ ${surefire.parallel.timeout}
+ ${perCoreThreadCount}
+ ${surefire.printSummary}
+ ${maven.test.redirectTestOutputToFile}
+
+ ${surefire.reportFormat}
+ ${surefire.reportNameSuffix}
+
+ ${surefire.rerunFailingTestsCount}
+ ${reuseForks}
+ ${surefire.runOrder}
+ ${surefire.shutdown}
+ ${maven.test.skip}
+ ${surefire.skipAfterFailureCount}
+ ${maven.test.skip.exec}
+ ${skipTests}
+ ${surefire.suiteXmlFiles}
+ ${tempDir}
+ ${test}
+
+ ${maven.test.failure.ignore}
+ ${testNGArtifactName}
+
+ ${threadCount}
+ ${threadCountClasses}
+ ${threadCountMethods}
+ ${threadCountSuites}
+ ${trimStackTrace}
+ ${surefire.useFile}
+ ${surefire.useManifestOnlyJar}
+ ${surefire.useSystemClassLoader}
+ ${useUnlimitedThreads}
+ ${basedir}
+
+
+
+
--- surefire-2.22.0/maven-surefire-plugin/src/main/filtered-resources/META-INF/maven/plugin.xml 1970-01-01 01:00:00.000000000 +0100
+++ surefire-2.22.0/maven-surefire-plugin/src/main/filtered-resources/META-INF/maven/plugin.xml 2019-04-01 16:35:39.493479592 +0200
@@ -0,0 +1,1060 @@
+
+
+ ${project.name}
+ ${project.description}
+ ${project.groupId}
+ ${project.artifactId}
+ ${project.version}
+ surefire
+ false
+ true
+
+
+ help
+ Display help information on maven-surefire-plugin.<br>
+Call <code>mvn surefire:help -Ddetail=true -Dgoal=<goal-name></code> to display parameter details.
+ false
+ false
+ false
+ false
+ false
+ true
+ org.apache.maven.plugin.surefire.HelpMojo
+ java
+ per-lookup
+ once-per-session
+ true
+
+
+ detail
+ boolean
+ false
+ true
+ Display help information on maven-surefire-plugin.<br>
+Call <code>mvn surefire:help -Ddetail=true -Dgoal=<goal-name></code> to display parameter details.
+
+
+ goal
+ java.lang.String
+ false
+ true
+ Display help information on maven-surefire-plugin.<br>
+Call <code>mvn surefire:help -Ddetail=true -Dgoal=<goal-name></code> to display parameter details.
+
+
+ indentSize
+ int
+ false
+ true
+ Display help information on maven-surefire-plugin.<br>
+Call <code>mvn surefire:help -Ddetail=true -Dgoal=<goal-name></code> to display parameter details.
+
+
+ lineLength
+ int
+ false
+ true
+ Display help information on maven-surefire-plugin.<br>
+Call <code>mvn surefire:help -Ddetail=true -Dgoal=<goal-name></code> to display parameter details.
+
+
+
+ ${detail}
+ ${goal}
+ ${indentSize}
+ ${lineLength}
+
+
+
+ test
+ Run tests using Surefire.
+ test
+ false
+ true
+ false
+ false
+ false
+ true
+ test
+ org.apache.maven.plugin.surefire.SurefirePlugin
+ java
+ per-lookup
+ once-per-session
+ true
+
+
+ additionalClasspathElements
+ java.lang.String[]
+ 2.4
+ false
+ true
+ Run tests using Surefire.
+
+
+ argLine
+ java.lang.String
+ 2.1
+ false
+ true
+ Run tests using Surefire.
+
+
+ basedir
+ java.io.File
+ false
+ true
+ Run tests using Surefire.
+
+
+ childDelegation
+ boolean
+ 2.1
+ false
+ true
+ Run tests using Surefire.
+
+
+ classesDirectory
+ java.io.File
+ false
+ true
+ Run tests using Surefire.
+
+
+ classpathDependencyExcludes
+ java.lang.String[]
+ 2.6
+ false
+ true
+ Run tests using Surefire.
+
+
+ classpathDependencyScopeExclude
+ java.lang.String
+ 2.6
+ false
+ true
+ Run tests using Surefire.
+
+
+ debugForkedProcess
+ java.lang.String
+ 2.4
+ false
+ true
+ Run tests using Surefire.
+
+
+ dependenciesToScan
+ java.lang.String[]
+ 2.15
+ false
+ true
+ Run tests using Surefire.
+
+
+ disableXmlReport
+ boolean
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ enableAssertions
+ boolean
+ 2.3.1
+ false
+ true
+ Run tests using Surefire.
+
+
+ encoding
+ java.lang.String
+ 3.0.0-M1
+ false
+ true
+ Run tests using Surefire.
+
+
+ environmentVariables
+ java.util.Map
+ 2.1.3
+ false
+ true
+ Run tests using Surefire.
+
+
+ excludedGroups
+ java.lang.String
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ excludes
+ java.util.List
+ false
+ true
+ Run tests using Surefire.
+
+
+ excludesFile
+ java.io.File
+ false
+ true
+ Run tests using Surefire.
+
+
+ failIfNoSpecifiedTests
+ java.lang.Boolean
+ 2.12
+ false
+ true
+ Run tests using Surefire.
+
+
+ failIfNoTests
+ java.lang.Boolean
+ 2.4
+ false
+ true
+ Run tests using Surefire.
+
+
+ forkCount
+ java.lang.String
+ 2.14
+ false
+ true
+ Run tests using Surefire.
+
+
+ forkMode
+ java.lang.String
+ 2.1
+ false
+ true
+ Run tests using Surefire.
+
+
+ forkedProcessExitTimeoutInSeconds
+ int
+ 2.20
+ false
+ true
+ Run tests using Surefire.
+
+
+ forkedProcessTimeoutInSeconds
+ int
+ 2.4
+ false
+ true
+ Run tests using Surefire.
+
+
+ groups
+ java.lang.String
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ includes
+ java.util.List
+ false
+ true
+ Run tests using Surefire.
+
+
+ includesFile
+ java.io.File
+ false
+ true
+ Run tests using Surefire.
+
+
+ junitArtifactName
+ java.lang.String
+ 2.3.1
+ false
+ true
+ Run tests using Surefire.
+
+
+ junitPlatformArtifactName
+ java.lang.String
+ 2.22.0
+ false
+ true
+ Run tests using Surefire.
+
+
+ jvm
+ java.lang.String
+ 2.1
+ false
+ true
+ Run tests using Surefire.
+
+
+ localRepository
+ org.apache.maven.artifact.repository.ArtifactRepository
+ true
+ false
+ Run tests using Surefire.
+
+
+ objectFactory
+ java.lang.String
+ 2.5
+ false
+ true
+ Run tests using Surefire.
+
+
+ parallel
+ java.lang.String
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ parallelMavenExecution
+ java.lang.Boolean
+ false
+ false
+ Run tests using Surefire.
+
+
+ parallelOptimized
+ boolean
+ 2.17
+ false
+ true
+ Run tests using Surefire.
+
+
+ parallelTestsTimeoutForcedInSeconds
+ double
+ 2.16
+ false
+ true
+ Run tests using Surefire.
+
+
+ parallelTestsTimeoutInSeconds
+ double
+ 2.16
+ false
+ true
+ Run tests using Surefire.
+
+
+ perCoreThreadCount
+ boolean
+ 2.5
+ false
+ true
+ Run tests using Surefire.
+
+
+ pluginArtifactMap
+ java.util.Map
+ true
+ false
+ Run tests using Surefire.
+
+
+ pluginDescriptor
+ org.apache.maven.plugin.descriptor.PluginDescriptor
+ 2.12
+ false
+ false
+ Run tests using Surefire.
+
+
+ printSummary
+ boolean
+ false
+ true
+ Run tests using Surefire.
+
+
+ projectArtifactMap
+ java.util.Map
+ true
+ false
+ Run tests using Surefire.
+
+
+ projectBuildDirectory
+ java.io.File
+ 2.20
+ false
+ false
+ Run tests using Surefire.
+
+
+ properties
+ java.util.Properties
+ 2.4
+ false
+ true
+ Run tests using Surefire.
+
+
+ redirectTestOutputToFile
+ boolean
+ 2.3
+ false
+ true
+ Run tests using Surefire.
+
+
+ remoteRepositories
+ java.util.List
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ reportFormat
+ java.lang.String
+ false
+ true
+ Run tests using Surefire.
+
+
+ reportNameSuffix
+ java.lang.String
+ false
+ true
+ Run tests using Surefire.
+
+
+ reportsDirectory
+ java.io.File
+ false
+ true
+ Run tests using Surefire.
+
+
+ rerunFailingTestsCount
+ int
+ false
+ true
+ Run tests using Surefire.
+
+
+ reuseForks
+ boolean
+ 2.13
+ false
+ true
+ Run tests using Surefire.
+
+
+ runOrder
+ java.lang.String
+ 2.7
+ false
+ true
+ Run tests using Surefire.
+
+
+ shutdown
+ java.lang.String
+ 2.19
+ false
+ true
+ Run tests using Surefire.
+
+
+ skip
+ boolean
+ false
+ true
+ Run tests using Surefire.
+
+
+ skipAfterFailureCount
+ int
+ 2.19
+ false
+ true
+ Run tests using Surefire.
+
+
+ skipExec
+ boolean
+ 2.3
+ Use skipTests instead.
+ false
+ true
+ Run tests using Surefire.
+
+
+ skipTests
+ boolean
+ 2.4
+ false
+ true
+ Run tests using Surefire.
+
+
+ suiteXmlFiles
+ java.io.File[]
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ systemProperties
+ java.util.Properties
+ Use systemPropertyVariables instead.
+ false
+ true
+ Run tests using Surefire.
+
+
+ systemPropertiesFile
+ java.io.File
+ 2.8.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ systemPropertyVariables
+ java.util.Map
+ 2.5
+ false
+ true
+ Run tests using Surefire.
+
+
+ tempDir
+ java.lang.String
+ 2.20
+ false
+ true
+ Run tests using Surefire.
+
+
+ test
+ java.lang.String
+ false
+ true
+ Run tests using Surefire.
+
+
+ testClassesDirectory
+ java.io.File
+ false
+ true
+ Run tests using Surefire.
+
+
+ testFailureIgnore
+ boolean
+ false
+ true
+ Run tests using Surefire.
+
+
+ testNGArtifactName
+ java.lang.String
+ 2.3.1
+ false
+ true
+ Run tests using Surefire.
+
+
+ testSourceDirectory
+ java.io.File
+ 2.2
+ true
+ true
+ Run tests using Surefire.
+
+
+ threadCount
+ int
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ threadCountClasses
+ int
+ 2.16
+ false
+ true
+ Run tests using Surefire.
+
+
+ threadCountMethods
+ int
+ 2.16
+ false
+ true
+ Run tests using Surefire.
+
+
+ threadCountSuites
+ int
+ 2.16
+ false
+ true
+ Run tests using Surefire.
+
+
+ trimStackTrace
+ boolean
+ 2.2
+ false
+ true
+ Run tests using Surefire.
+
+
+ useFile
+ boolean
+ false
+ true
+ Run tests using Surefire.
+
+
+ useManifestOnlyJar
+ boolean
+ 2.4.3
+ false
+ true
+ Run tests using Surefire.
+
+
+ useSystemClassLoader
+ boolean
+ 2.3
+ false
+ true
+ Run tests using Surefire.
+
+
+ useUnlimitedThreads
+ boolean
+ 2.5
+ false
+ true
+ Run tests using Surefire.
+
+
+ workingDirectory
+ java.io.File
+ 2.1.3
+ false
+ true
+ Run tests using Surefire.
+
+
+ project
+ org.apache.maven.project.MavenProject
+ true
+ false
+
+
+
+ session
+ org.apache.maven.execution.MavenSession
+ true
+ false
+
+
+
+
+ ${maven.test.additionalClasspath}
+ ${argLine}
+
+ ${childDelegation}
+
+ ${maven.test.dependency.excludes}
+ ${maven.surefire.debug}
+ ${dependenciesToScan}
+ ${disableXmlReport}
+ ${enableAssertions}
+ ${surefire.encoding}
+ ${excludedGroups}
+ ${surefire.excludesFile}
+ ${surefire.failIfNoSpecifiedTests}
+ ${failIfNoTests}
+ ${forkCount}
+ ${forkMode}
+ ${surefire.exitTimeout}
+ ${surefire.timeout}
+ ${groups}
+ ${surefire.includesFile}
+ ${junitArtifactName}
+ ${junitPlatformArtifactName}
+ ${jvm}
+
+ ${objectFactory}
+ ${parallel}
+
+ ${parallelOptimized}
+ ${surefire.parallel.forcedTimeout}
+ ${surefire.parallel.timeout}
+ ${perCoreThreadCount}
+ ${plugin.artifactMap}
+
+ ${surefire.printSummary}
+ ${project.artifactMap}
+
+ ${maven.test.redirectTestOutputToFile}
+
+ ${surefire.reportFormat}
+ ${surefire.reportNameSuffix}
+
+ ${surefire.rerunFailingTestsCount}
+ ${reuseForks}
+ ${surefire.runOrder}
+ ${surefire.shutdown}
+ ${maven.test.skip}
+ ${surefire.skipAfterFailureCount}
+ ${maven.test.skip.exec}
+ ${skipTests}
+ ${surefire.suiteXmlFiles}
+ ${tempDir}
+ ${test}
+
+ ${maven.test.failure.ignore}
+ ${testNGArtifactName}
+
+ ${threadCount}
+ ${threadCountClasses}
+ ${threadCountMethods}
+ ${threadCountSuites}
+ ${trimStackTrace}
+ ${surefire.useFile}
+ ${surefire.useManifestOnlyJar}
+ ${surefire.useSystemClassLoader}
+ ${useUnlimitedThreads}
+ ${basedir}
+
+
+
+
+
+ org.apache.maven.artifact.factory.ArtifactFactory
+ artifactFactory
+
+
+ org.apache.maven.artifact.resolver.ArtifactResolver
+ artifactResolver
+
+
+ org.codehaus.plexus.logging.Logger
+ logger
+
+
+ org.apache.maven.artifact.metadata.ArtifactMetadataSource
+ metadataSource
+
+
+ org.apache.maven.toolchain.ToolchainManager
+ toolchainManager
+
+
+
+
+
+
+ org.apache.maven.surefire
+ maven-surefire-common
+ jar
+ 2.22.0
+
+
+ org.apache.maven
+ maven-plugin-api
+ jar
+ 3.3.3
+
+
+ org.codehaus.plexus
+ plexus-classworlds
+ jar
+ 2.5.2
+
+
+ org.codehaus.plexus
+ plexus-utils
+ jar
+ 3.1.0
+
+
+ org.eclipse.sisu
+ org.eclipse.sisu.plexus
+ jar
+ 0.3.3
+
+
+ org.apache.maven.plugin-tools
+ maven-plugin-annotations
+ jar
+ 3.5
+
+
+ org.apache.maven
+ maven-compat
+ jar
+ any
+
+
+ org.codehaus.plexus
+ plexus-interpolation
+ jar
+ 1.24
+
+
+ org.apache.maven.wagon
+ wagon-provider-api
+ jar
+ 3.1.0
+
+
+ org.apache.maven.surefire
+ surefire-api
+ jar
+ 2.22.0
+
+
+ org.apache.maven.surefire
+ surefire-logger-api
+ jar
+ 2.22.0
+
+
+ org.apache.maven.surefire
+ surefire-booter
+ jar
+ 2.22.0
+
+
+ org.apache.maven.shared
+ maven-shared-utils
+ jar
+ 3.2.1
+
+
+ org.apache.maven
+ maven-artifact
+ jar
+ 3.3.3
+
+
+ commons-io
+ commons-io
+ jar
+ 2.5
+
+
+ org.apache.maven
+ maven-model
+ jar
+ 3.3.3
+
+
+ org.apache.maven
+ maven-core
+ jar
+ 3.3.3
+
+
+ org.apache.maven
+ maven-settings
+ jar
+ 3.3.3
+
+
+ org.apache.maven.resolver
+ maven-resolver-util
+ jar
+ 1.1.1
+
+
+ org.eclipse.sisu
+ org.eclipse.sisu.inject
+ jar
+ 0.3.3
+
+
+ javax.enterprise
+ cdi-api
+ jar
+ 1.1
+
+
+ javax.el
+ javax.el-api
+ jar
+ 3.0.0
+
+
+ org.jboss.spec.javax.interceptor
+ jboss-interceptors-api_1.2_spec
+ jar
+ any
+
+
+ com.google.guava
+ guava
+ jar
+ 20.0
+
+
+ com.google.inject
+ guice
+ jar
+ 4.2.0
+
+
+ aopalliance
+ aopalliance
+ jar
+ 1.0
+
+
+ cglib
+ cglib
+ jar
+ 3.2.0
+
+
+ org.apache.maven
+ maven-resolver-provider
+ jar
+ 3.5.4
+
+
+ org.apache.maven.resolver
+ maven-resolver-api
+ jar
+ 1.1.1
+
+
+ javax.inject
+ javax.inject
+ jar
+ 1
+
+
+ org.apache.maven.resolver
+ maven-resolver-impl
+ jar
+ 1.1.1
+
+
+ org.slf4j
+ slf4j-api
+ jar
+ 1.7.25
+
+
+ org.apache.maven
+ maven-repository-metadata
+ jar
+ 3.5.4
+
+
+ org.apache.maven.resolver
+ maven-resolver-spi
+ jar
+ 1.1.1
+
+
+ org.codehaus.plexus
+ plexus-component-annotations
+ jar
+ 1.5.5
+
+
+ org.apache.maven
+ maven-model-builder
+ jar
+ 3.5.4
+
+
+ org.apache.maven
+ maven-builder-support
+ jar
+ 3.5.4
+
+
+ org.apache.maven
+ maven-settings-builder
+ jar
+ 3.5.4
+
+
+ org.sonatype.plexus
+ plexus-sec-dispatcher
+ jar
+ 1.4
+
+
+ org.sonatype.plexus
+ plexus-cipher
+ jar
+ 1.4
+
+
+ junit
+ junit
+ jar
+ 4.12
+
+
+ org.hamcrest
+ hamcrest-core
+ jar
+ 1.3
+
+
+ org.apache.commons
+ commons-lang3
+ jar
+ 3.5
+
+
+ org.apache.maven.shared
+ maven-common-artifact-filters
+ jar
+ 1.3
+
+
+ org.codehaus.plexus
+ plexus-java
+ jar
+ 0.9.8
+
+
+ org.ow2.asm
+ asm
+ jar
+ 6.2
+
+
+ com.thoughtworks.qdox
+ qdox
+ jar
+ 2.0-M8
+
+
+
--- surefire-2.22.0/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/HelpMojo.java 1970-01-01 01:00:00.000000000 +0100
+++ surefire-2.22.0/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/HelpMojo.java 2019-04-01 16:37:53.006154740 +0200
@@ -0,0 +1,458 @@
+
+package org.apache.maven.plugin.surefire;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Display help information on maven-surefire-plugin.
+ * Call mvn surefire:help -Ddetail=true -Dgoal=<goal-name>
to display parameter details.
+ * @author maven-plugin-tools
+ */
+@Mojo( name = "help", requiresProject = false, threadSafe = true )
+public class HelpMojo
+ extends AbstractMojo
+{
+ /**
+ * If true
, display all settable properties for each goal.
+ *
+ */
+ @Parameter( property = "detail", defaultValue = "false" )
+ private boolean detail;
+
+ /**
+ * The name of the goal for which to show help. If unspecified, all goals will be displayed.
+ *
+ */
+ @Parameter( property = "goal" )
+ private java.lang.String goal;
+
+ /**
+ * The maximum length of a display line, should be positive.
+ *
+ */
+ @Parameter( property = "lineLength", defaultValue = "80" )
+ private int lineLength;
+
+ /**
+ * The number of spaces per indentation level, should be positive.
+ *
+ */
+ @Parameter( property = "indentSize", defaultValue = "2" )
+ private int indentSize;
+
+ // groupId/artifactId/plugin-help.xml
+ private static final String PLUGIN_HELP_PATH =
+ "/META-INF/maven/org.apache.maven.plugins/maven-surefire-plugin/plugin-help.xml";
+
+ private static final int DEFAULT_LINE_LENGTH = 80;
+
+ private Document build()
+ throws MojoExecutionException
+ {
+ getLog().debug( "load plugin-help.xml: " + PLUGIN_HELP_PATH );
+ InputStream is = null;
+ try
+ {
+ is = getClass().getResourceAsStream( PLUGIN_HELP_PATH );
+ DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+ return dBuilder.parse( is );
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException( e.getMessage(), e );
+ }
+ catch ( ParserConfigurationException e )
+ {
+ throw new MojoExecutionException( e.getMessage(), e );
+ }
+ catch ( SAXException e )
+ {
+ throw new MojoExecutionException( e.getMessage(), e );
+ }
+ finally
+ {
+ if ( is != null )
+ {
+ try
+ {
+ is.close();
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException( e.getMessage(), e );
+ }
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void execute()
+ throws MojoExecutionException
+ {
+ if ( lineLength <= 0 )
+ {
+ getLog().warn( "The parameter 'lineLength' should be positive, using '80' as default." );
+ lineLength = DEFAULT_LINE_LENGTH;
+ }
+ if ( indentSize <= 0 )
+ {
+ getLog().warn( "The parameter 'indentSize' should be positive, using '2' as default." );
+ indentSize = 2;
+ }
+
+ Document doc = build();
+
+ StringBuilder sb = new StringBuilder();
+ Node plugin = getSingleChild( doc, "plugin" );
+
+
+ String name = getValue( plugin, "name" );
+ String version = getValue( plugin, "version" );
+ String id = getValue( plugin, "groupId" ) + ":" + getValue( plugin, "artifactId" ) + ":" + version;
+ if ( isNotEmpty( name ) && !name.contains( id ) )
+ {
+ append( sb, name + " " + version, 0 );
+ }
+ else
+ {
+ if ( isNotEmpty( name ) )
+ {
+ append( sb, name, 0 );
+ }
+ else
+ {
+ append( sb, id, 0 );
+ }
+ }
+ append( sb, getValue( plugin, "description" ), 1 );
+ append( sb, "", 0 );
+
+ //plugin
+ String goalPrefix = getValue( plugin, "goalPrefix" );
+
+ Node mojos1 = getSingleChild( plugin, "mojos" );
+
+ List mojos = findNamedChild( mojos1, "mojo" );
+
+ if ( goal == null || goal.length() <= 0 )
+ {
+ append( sb, "This plugin has " + mojos.size() + ( mojos.size() > 1 ? " goals:" : " goal:" ), 0 );
+ append( sb, "", 0 );
+ }
+
+ for ( Node mojo : mojos )
+ {
+ writeGoal( sb, goalPrefix, (Element) mojo );
+ }
+
+ if ( getLog().isInfoEnabled() )
+ {
+ getLog().info( sb.toString() );
+ }
+ }
+
+
+ private static boolean isNotEmpty( String string )
+ {
+ return string != null && string.length() > 0;
+ }
+
+ private String getValue( Node node, String elementName )
+ throws MojoExecutionException
+ {
+ return getSingleChild( node, elementName ).getTextContent();
+ }
+
+ private Node getSingleChild( Node node, String elementName )
+ throws MojoExecutionException
+ {
+ List namedChild = findNamedChild( node, elementName );
+ if ( namedChild.isEmpty() )
+ {
+ throw new MojoExecutionException( "Could not find " + elementName + " in plugin-help.xml" );
+ }
+ if ( namedChild.size() > 1 )
+ {
+ throw new MojoExecutionException( "Multiple " + elementName + " in plugin-help.xml" );
+ }
+ return namedChild.get( 0 );
+ }
+
+ private List findNamedChild( Node node, String elementName )
+ {
+ List result = new ArrayList();
+ NodeList childNodes = node.getChildNodes();
+ for ( int i = 0; i < childNodes.getLength(); i++ )
+ {
+ Node item = childNodes.item( i );
+ if ( elementName.equals( item.getNodeName() ) )
+ {
+ result.add( item );
+ }
+ }
+ return result;
+ }
+
+ private Node findSingleChild( Node node, String elementName )
+ throws MojoExecutionException
+ {
+ List elementsByTagName = findNamedChild( node, elementName );
+ if ( elementsByTagName.isEmpty() )
+ {
+ return null;
+ }
+ if ( elementsByTagName.size() > 1 )
+ {
+ throw new MojoExecutionException( "Multiple " + elementName + "in plugin-help.xml" );
+ }
+ return elementsByTagName.get( 0 );
+ }
+
+ private void writeGoal( StringBuilder sb, String goalPrefix, Element mojo )
+ throws MojoExecutionException
+ {
+ String mojoGoal = getValue( mojo, "goal" );
+ Node configurationElement = findSingleChild( mojo, "configuration" );
+ Node description = findSingleChild( mojo, "description" );
+ if ( goal == null || goal.length() <= 0 || mojoGoal.equals( goal ) )
+ {
+ append( sb, goalPrefix + ":" + mojoGoal, 0 );
+ Node deprecated = findSingleChild( mojo, "deprecated" );
+ if ( ( deprecated != null ) && isNotEmpty( deprecated.getTextContent() ) )
+ {
+ append( sb, "Deprecated. " + deprecated.getTextContent(), 1 );
+ if ( detail && description != null )
+ {
+ append( sb, "", 0 );
+ append( sb, description.getTextContent(), 1 );
+ }
+ }
+ else if ( description != null )
+ {
+ append( sb, description.getTextContent(), 1 );
+ }
+ append( sb, "", 0 );
+
+ if ( detail )
+ {
+ Node parametersNode = getSingleChild( mojo, "parameters" );
+ List parameters = findNamedChild( parametersNode, "parameter" );
+ append( sb, "Available parameters:", 1 );
+ append( sb, "", 0 );
+
+ for ( Node parameter : parameters )
+ {
+ writeParameter( sb, parameter, configurationElement );
+ }
+ }
+ }
+ }
+
+ private void writeParameter( StringBuilder sb, Node parameter, Node configurationElement )
+ throws MojoExecutionException
+ {
+ String parameterName = getValue( parameter, "name" );
+ String parameterDescription = getValue( parameter, "description" );
+
+ Element fieldConfigurationElement = null;
+ if ( configurationElement != null )
+ {
+ fieldConfigurationElement = (Element) findSingleChild( configurationElement, parameterName );
+ }
+
+ String parameterDefaultValue = "";
+ if ( fieldConfigurationElement != null && fieldConfigurationElement.hasAttribute( "default-value" ) )
+ {
+ parameterDefaultValue = " (Default: " + fieldConfigurationElement.getAttribute( "default-value" ) + ")";
+ }
+ append( sb, parameterName + parameterDefaultValue, 2 );
+ Node deprecated = findSingleChild( parameter, "deprecated" );
+ if ( ( deprecated != null ) && isNotEmpty( deprecated.getTextContent() ) )
+ {
+ append( sb, "Deprecated. " + deprecated.getTextContent(), 3 );
+ append( sb, "", 0 );
+ }
+ append( sb, parameterDescription, 3 );
+ if ( "true".equals( getValue( parameter, "required" ) ) )
+ {
+ append( sb, "Required: Yes", 3 );
+ }
+ if ( ( fieldConfigurationElement != null ) && isNotEmpty( fieldConfigurationElement.getTextContent() ) )
+ {
+ String property = getPropertyFromExpression( fieldConfigurationElement.getTextContent() );
+ append( sb, "User property: " + property, 3 );
+ }
+
+ append( sb, "", 0 );
+ }
+
+ /**
+ * Repeat a String n
times to form a new string.
+ *
+ * @param str String to repeat
+ * @param repeat number of times to repeat str
+ * @return String with repeated String
+ * @throws NegativeArraySizeException if repeat < 0
+ * @throws NullPointerException if str is null
+ */
+ private static String repeat( String str, int repeat )
+ {
+ StringBuilder buffer = new StringBuilder( repeat * str.length() );
+
+ for ( int i = 0; i < repeat; i++ )
+ {
+ buffer.append( str );
+ }
+
+ return buffer.toString();
+ }
+
+ /**
+ * Append a description to the buffer by respecting the indentSize and lineLength parameters.
+ * Note: The last character is always a new line.
+ *
+ * @param sb The buffer to append the description, not null
.
+ * @param description The description, not null
.
+ * @param indent The base indentation level of each line, must not be negative.
+ */
+ private void append( StringBuilder sb, String description, int indent )
+ {
+ for ( String line : toLines( description, indent, indentSize, lineLength ) )
+ {
+ sb.append( line ).append( '\n' );
+ }
+ }
+
+ /**
+ * Splits the specified text into lines of convenient display length.
+ *
+ * @param text The text to split into lines, must not be null
.
+ * @param indent The base indentation level of each line, must not be negative.
+ * @param indentSize The size of each indentation, must not be negative.
+ * @param lineLength The length of the line, must not be negative.
+ * @return The sequence of display lines, never null
.
+ * @throws NegativeArraySizeException if indent < 0
+ */
+ private static List toLines( String text, int indent, int indentSize, int lineLength )
+ {
+ List lines = new ArrayList();
+
+ String ind = repeat( "\t", indent );
+
+ String[] plainLines = text.split( "(\r\n)|(\r)|(\n)" );
+
+ for ( String plainLine : plainLines )
+ {
+ toLines( lines, ind + plainLine, indentSize, lineLength );
+ }
+
+ return lines;
+ }
+
+ /**
+ * Adds the specified line to the output sequence, performing line wrapping if necessary.
+ *
+ * @param lines The sequence of display lines, must not be null
.
+ * @param line The line to add, must not be null
.
+ * @param indentSize The size of each indentation, must not be negative.
+ * @param lineLength The length of the line, must not be negative.
+ */
+ private static void toLines( List lines, String line, int indentSize, int lineLength )
+ {
+ int lineIndent = getIndentLevel( line );
+ StringBuilder buf = new StringBuilder( 256 );
+
+ String[] tokens = line.split( " +" );
+
+ for ( String token : tokens )
+ {
+ if ( buf.length() > 0 )
+ {
+ if ( buf.length() + token.length() >= lineLength )
+ {
+ lines.add( buf.toString() );
+ buf.setLength( 0 );
+ buf.append( repeat( " ", lineIndent * indentSize ) );
+ }
+ else
+ {
+ buf.append( ' ' );
+ }
+ }
+
+ for ( int j = 0; j < token.length(); j++ )
+ {
+ char c = token.charAt( j );
+ if ( c == '\t' )
+ {
+ buf.append( repeat( " ", indentSize - buf.length() % indentSize ) );
+ }
+ else if ( c == '\u00A0' )
+ {
+ buf.append( ' ' );
+ }
+ else
+ {
+ buf.append( c );
+ }
+ }
+ }
+ lines.add( buf.toString() );
+ }
+
+ /**
+ * Gets the indentation level of the specified line.
+ *
+ * @param line The line whose indentation level should be retrieved, must not be null
.
+ * @return The indentation level of the line.
+ */
+ private static int getIndentLevel( String line )
+ {
+ int level = 0;
+ for ( int i = 0; i < line.length() && line.charAt( i ) == '\t'; i++ )
+ {
+ level++;
+ }
+ for ( int i = level + 1; i <= level + 4 && i < line.length(); i++ )
+ {
+ if ( line.charAt( i ) == '\t' )
+ {
+ level++;
+ break;
+ }
+ }
+ return level;
+ }
+
+ private String getPropertyFromExpression( String expression )
+ {
+ if ( expression != null && expression.startsWith( "${" ) && expression.endsWith( "}" )
+ && !expression.substring( 2 ).contains( "${" ) )
+ {
+ // expression="${xxx}" -> property="xxx"
+ return expression.substring( 2, expression.length() - 1 );
+ }
+ // no property can be extracted
+ return null;
+ }
+}
--- surefire-2.22.0/maven-surefire-report-plugin/src/main/filtered-resources/META-INF/maven/org.apache.maven.plugins/maven-surefire-report-plugin/plugin-help.xml 1970-01-01 01:00:00.000000000 +0100
+++ surefire-2.22.0/maven-surefire-report-plugin/src/main/filtered-resources/META-INF/maven/org.apache.maven.plugins/maven-surefire-report-plugin/plugin-help.xml 2019-04-01 16:35:39.497479614 +0200
@@ -0,0 +1,398 @@
+
+
+ ${project.name}
+ ${project.description}
+ ${project.groupId}
+ ${project.artifactId}
+ ${project.version}
+ surefire-report
+
+
+ failsafe-report-only
+ Creates a nicely formatted Failsafe Test Report in html format. This goal does not run the tests, it only builds the reports. See https://issues.apache.org/jira/browse/SUREFIRE-257
+ false
+ true
+ false
+ false
+ false
+ true
+ org.apache.maven.plugins.surefire.report.FailsafeReportMojo
+ java
+ per-lookup
+ once-per-session
+ 2.10
+ false
+
+
+ aggregate
+ boolean
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ alwaysGenerateFailsafeReport
+ boolean
+ 2.11
+ false
+ true
+ Creates a nicely formatted Failsafe Test Report in html format. This goal does not run the tests, it only builds the reports. See https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ description
+ java.lang.String
+ 2.21.0
+ false
+ true
+ Creates a nicely formatted Failsafe Test Report in html format. This goal does not run the tests, it only builds the reports. See https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ linkXRef
+ boolean
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ outputName
+ java.lang.String
+ true
+ true
+ Creates a nicely formatted Failsafe Test Report in html format. This goal does not run the tests, it only builds the reports. See https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ reportsDirectories
+ java.io.File[]
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ reportsDirectory
+ java.io.File
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ showSuccess
+ boolean
+ true
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ skipFailsafeReport
+ boolean
+ 2.11
+ false
+ true
+ Creates a nicely formatted Failsafe Test Report in html format. This goal does not run the tests, it only builds the reports. See https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ title
+ java.lang.String
+ 2.21.0
+ false
+ true
+ Creates a nicely formatted Failsafe Test Report in html format. This goal does not run the tests, it only builds the reports. See https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ xrefLocation
+ java.io.File
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+
+ ${aggregate}
+ ${alwaysGenerateFailsafeReport}
+ ${failsafe.report.description}
+ ${linkXRef}
+ ${outputName}
+ ${showSuccess}
+ ${skipFailsafeReport}
+ ${failsafe.report.title}
+
+
+
+
+ help
+ Display help information on maven-surefire-report-plugin.
+Call mvn surefire-report:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
+ false
+ false
+ false
+ false
+ false
+ true
+ org.apache.maven.plugins.surefire.report.HelpMojo
+ java
+ per-lookup
+ once-per-session
+ true
+
+
+ detail
+ boolean
+ false
+ true
+ Display help information on maven-surefire-report-plugin.
+Call mvn surefire-report:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
+
+
+ goal
+ java.lang.String
+ false
+ true
+ Display help information on maven-surefire-report-plugin.
+Call mvn surefire-report:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
+
+
+ indentSize
+ int
+ false
+ true
+ Display help information on maven-surefire-report-plugin.
+Call mvn surefire-report:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
+
+
+ lineLength
+ int
+ false
+ true
+ Display help information on maven-surefire-report-plugin.
+Call mvn surefire-report:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.
+
+
+
+ ${detail}
+ ${goal}
+ ${indentSize}
+ ${lineLength}
+
+
+
+ report
+ Creates a nicely formatted Surefire Test Report in html format.
+ false
+ true
+ false
+ false
+ false
+ false
+ test
+ surefire
+ org.apache.maven.plugins.surefire.report.SurefireReportMojo
+ java
+ per-lookup
+ once-per-session
+ false
+
+
+ aggregate
+ boolean
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ alwaysGenerateSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ description
+ java.lang.String
+ 2.21.0
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ linkXRef
+ boolean
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ outputName
+ java.lang.String
+ true
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ reportsDirectories
+ java.io.File[]
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ reportsDirectory
+ java.io.File
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ showSuccess
+ boolean
+ true
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ skipSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ title
+ java.lang.String
+ 2.21.0
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ xrefLocation
+ java.io.File
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+
+ ${aggregate}
+ ${alwaysGenerateSurefireReport}
+ ${surefire.report.description}
+ ${linkXRef}
+ ${outputName}
+ ${showSuccess}
+ ${skipSurefireReport}
+ ${surefire.report.title}
+
+
+
+
+ report-only
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+ false
+ true
+ false
+ false
+ false
+ true
+ org.apache.maven.plugins.surefire.report.SurefireReportOnlyMojo
+ java
+ per-lookup
+ once-per-session
+ 2.3
+ false
+
+
+ aggregate
+ boolean
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ alwaysGenerateSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ description
+ java.lang.String
+ 2.21.0
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ linkXRef
+ boolean
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ outputName
+ java.lang.String
+ true
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ reportsDirectories
+ java.io.File[]
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ reportsDirectory
+ java.io.File
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ showSuccess
+ boolean
+ true
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ skipSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ title
+ java.lang.String
+ 2.21.0
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+ xrefLocation
+ java.io.File
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format. This goal does not run the tests, it only builds the reports. This is a workaround for https://issues.apache.org/jira/browse/SUREFIRE-257
+
+
+
+ ${aggregate}
+ ${alwaysGenerateSurefireReport}
+ ${surefire.report.description}
+ ${linkXRef}
+ ${outputName}
+ ${showSuccess}
+ ${skipSurefireReport}
+ ${surefire.report.title}
+
+
+
+
+
--- surefire-2.22.0/maven-surefire-report-plugin/src/main/filtered-resources/META-INF/maven/plugin.xml 1970-01-01 01:00:00.000000000 +0100
+++ surefire-2.22.0/maven-surefire-report-plugin/src/main/filtered-resources/META-INF/maven/plugin.xml 2019-04-01 16:35:39.497479614 +0200
@@ -0,0 +1,1086 @@
+
+
+ ${project.name}
+ ${project.description}
+ ${project.groupId}
+ ${project.artifactId}
+ ${project.version}
+ surefire-report
+ false
+ true
+
+
+ failsafe-report-only
+ Creates a nicely formatted Failsafe Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+See <a href="https://issues.apache.org/jira/browse/SUREFIRE-257">
+ https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+ false
+ true
+ false
+ false
+ false
+ true
+ org.apache.maven.plugins.surefire.report.FailsafeReportMojo
+ java
+ per-lookup
+ once-per-session
+ 2.10
+ false
+
+
+ aggregate
+ boolean
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ alwaysGenerateFailsafeReport
+ boolean
+ 2.11
+ false
+ true
+ Creates a nicely formatted Failsafe Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+See <a href="https://issues.apache.org/jira/browse/SUREFIRE-257">
+ https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ description
+ java.lang.String
+ 2.21.0
+ false
+ true
+ Creates a nicely formatted Failsafe Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+See <a href="https://issues.apache.org/jira/browse/SUREFIRE-257">
+ https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ inputEncoding
+ java.lang.String
+ false
+ false
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ linkXRef
+ boolean
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ outputDirectory
+ java.io.File
+ true
+ false
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ outputEncoding
+ java.lang.String
+ false
+ false
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ outputName
+ java.lang.String
+ true
+ true
+ Creates a nicely formatted Failsafe Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+See <a href="https://issues.apache.org/jira/browse/SUREFIRE-257">
+ https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ project
+ org.apache.maven.project.MavenProject
+ true
+ false
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ reactorProjects
+ java.util.List
+ false
+ false
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ reportsDirectories
+ java.io.File[]
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ reportsDirectory
+ java.io.File
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ showSuccess
+ boolean
+ true
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ skipFailsafeReport
+ boolean
+ 2.11
+ false
+ true
+ Creates a nicely formatted Failsafe Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+See <a href="https://issues.apache.org/jira/browse/SUREFIRE-257">
+ https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ title
+ java.lang.String
+ 2.21.0
+ false
+ true
+ Creates a nicely formatted Failsafe Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+See <a href="https://issues.apache.org/jira/browse/SUREFIRE-257">
+ https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ xrefLocation
+ java.io.File
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+
+ ${aggregate}
+ ${alwaysGenerateFailsafeReport}
+ ${failsafe.report.description}
+ ${encoding}
+ ${linkXRef}
+
+ ${outputEncoding}
+ ${outputName}
+
+
+ ${showSuccess}
+ ${skipFailsafeReport}
+ ${failsafe.report.title}
+
+
+
+
+ org.apache.maven.doxia.siterenderer.Renderer
+ siteRenderer
+
+
+
+
+ help
+ Display help information on maven-surefire-report-plugin.<br>
+Call <code>mvn surefire-report:help -Ddetail=true -Dgoal=<goal-name></code> to display parameter details.
+ false
+ false
+ false
+ false
+ false
+ true
+ org.apache.maven.plugins.surefire.report.HelpMojo
+ java
+ per-lookup
+ once-per-session
+ true
+
+
+ detail
+ boolean
+ false
+ true
+ Display help information on maven-surefire-report-plugin.<br>
+Call <code>mvn surefire-report:help -Ddetail=true -Dgoal=<goal-name></code> to display parameter details.
+
+
+ goal
+ java.lang.String
+ false
+ true
+ Display help information on maven-surefire-report-plugin.<br>
+Call <code>mvn surefire-report:help -Ddetail=true -Dgoal=<goal-name></code> to display parameter details.
+
+
+ indentSize
+ int
+ false
+ true
+ Display help information on maven-surefire-report-plugin.<br>
+Call <code>mvn surefire-report:help -Ddetail=true -Dgoal=<goal-name></code> to display parameter details.
+
+
+ lineLength
+ int
+ false
+ true
+ Display help information on maven-surefire-report-plugin.<br>
+Call <code>mvn surefire-report:help -Ddetail=true -Dgoal=<goal-name></code> to display parameter details.
+
+
+
+ ${detail}
+ ${goal}
+ ${indentSize}
+ ${lineLength}
+
+
+
+ report
+ Creates a nicely formatted Surefire Test Report in html format.
+ false
+ true
+ false
+ false
+ false
+ false
+ test
+ surefire
+ org.apache.maven.plugins.surefire.report.SurefireReportMojo
+ java
+ per-lookup
+ once-per-session
+ false
+
+
+ aggregate
+ boolean
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ alwaysGenerateSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ description
+ java.lang.String
+ 2.21.0
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ inputEncoding
+ java.lang.String
+ false
+ false
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ linkXRef
+ boolean
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ outputDirectory
+ java.io.File
+ true
+ false
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ outputEncoding
+ java.lang.String
+ false
+ false
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ outputName
+ java.lang.String
+ true
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ project
+ org.apache.maven.project.MavenProject
+ true
+ false
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ reactorProjects
+ java.util.List
+ false
+ false
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ reportsDirectories
+ java.io.File[]
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ reportsDirectory
+ java.io.File
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ showSuccess
+ boolean
+ true
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ skipSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ title
+ java.lang.String
+ 2.21.0
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ xrefLocation
+ java.io.File
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+
+ ${aggregate}
+ ${alwaysGenerateSurefireReport}
+ ${surefire.report.description}
+ ${encoding}
+ ${linkXRef}
+
+ ${outputEncoding}
+ ${outputName}
+
+
+ ${showSuccess}
+ ${skipSurefireReport}
+ ${surefire.report.title}
+
+
+
+
+ org.apache.maven.doxia.siterenderer.Renderer
+ siteRenderer
+
+
+
+
+ report-only
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+ false
+ true
+ false
+ false
+ false
+ true
+ org.apache.maven.plugins.surefire.report.SurefireReportOnlyMojo
+ java
+ per-lookup
+ once-per-session
+ 2.3
+ false
+
+
+ aggregate
+ boolean
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ alwaysGenerateSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ description
+ java.lang.String
+ 2.21.0
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ inputEncoding
+ java.lang.String
+ false
+ false
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ linkXRef
+ boolean
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ outputDirectory
+ java.io.File
+ true
+ false
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ outputEncoding
+ java.lang.String
+ false
+ false
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ outputName
+ java.lang.String
+ true
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ project
+ org.apache.maven.project.MavenProject
+ true
+ false
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ reactorProjects
+ java.util.List
+ false
+ false
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ reportsDirectories
+ java.io.File[]
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ reportsDirectory
+ java.io.File
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ showSuccess
+ boolean
+ true
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ skipSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ title
+ java.lang.String
+ 2.21.0
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+ xrefLocation
+ java.io.File
+ false
+ true
+ Creates a nicely formatted Surefire Test Report in html format.
+This goal does not run the tests, it only builds the reports.
+This is a workaround for
+<a href="https://issues.apache.org/jira/browse/SUREFIRE-257">https://issues.apache.org/jira/browse/SUREFIRE-257</a>
+
+
+
+ ${aggregate}
+ ${alwaysGenerateSurefireReport}
+ ${surefire.report.description}
+ ${encoding}
+ ${linkXRef}
+
+ ${outputEncoding}
+ ${outputName}
+
+
+ ${showSuccess}
+ ${skipSurefireReport}
+ ${surefire.report.title}
+
+
+
+
+ org.apache.maven.doxia.siterenderer.Renderer
+ siteRenderer
+
+
+
+
+
+
+ org.apache.maven
+ maven-model
+ jar
+ 3.3.3
+
+
+ org.apache.commons
+ commons-lang3
+ jar
+ 3.5
+
+
+ org.apache.maven
+ maven-plugin-api
+ jar
+ 3.3.3
+
+
+ org.codehaus.plexus
+ plexus-classworlds
+ jar
+ 2.5.2
+
+
+ org.apache.maven
+ maven-artifact
+ jar
+ 3.3.3
+
+
+ org.eclipse.sisu
+ org.eclipse.sisu.plexus
+ jar
+ 0.3.3
+
+
+ org.eclipse.sisu
+ org.eclipse.sisu.inject
+ jar
+ 0.3.3
+
+
+ javax.enterprise
+ cdi-api
+ jar
+ 1.1
+
+
+ javax.el
+ javax.el-api
+ jar
+ 3.0.0
+
+
+ org.jboss.spec.javax.interceptor
+ jboss-interceptors-api_1.2_spec
+ jar
+ any
+
+
+ org.apache.maven.plugin-tools
+ maven-plugin-annotations
+ jar
+ 3.5
+
+
+ org.apache.maven
+ maven-compat
+ jar
+ any
+
+
+ org.apache.maven
+ maven-settings
+ jar
+ 3.3.3
+
+
+ org.apache.maven
+ maven-model-builder
+ jar
+ 3.5.4
+
+
+ org.apache.maven
+ maven-repository-metadata
+ jar
+ 3.5.4
+
+
+ org.codehaus.plexus
+ plexus-interpolation
+ jar
+ 1.24
+
+
+ org.apache.maven.wagon
+ wagon-provider-api
+ jar
+ 3.1.0
+
+
+ org.apache.maven
+ maven-resolver-provider
+ jar
+ 3.5.4
+
+
+ org.apache.maven.resolver
+ maven-resolver-api
+ jar
+ 1.1.1
+
+
+ org.apache.maven.resolver
+ maven-resolver-util
+ jar
+ 1.1.1
+
+
+ org.apache.maven.resolver
+ maven-resolver-impl
+ jar
+ 1.1.1
+
+
+ org.slf4j
+ slf4j-api
+ jar
+ 1.7.25
+
+
+ org.apache.maven
+ maven-settings-builder
+ jar
+ 3.5.4
+
+
+ org.sonatype.plexus
+ plexus-sec-dispatcher
+ jar
+ 1.4
+
+
+ org.sonatype.plexus
+ plexus-cipher
+ jar
+ 1.4
+
+
+ junit
+ junit
+ jar
+ 4.12
+
+
+ org.hamcrest
+ hamcrest-core
+ jar
+ 1.3
+
+
+ org.apache.maven.surefire
+ surefire-report-parser
+ jar
+ 2.22.0
+
+
+ org.apache.maven.surefire
+ surefire-logger-api
+ jar
+ 2.22.0
+
+
+ org.apache.maven.reporting
+ maven-reporting-api
+ jar
+ 3.0
+
+
+ org.apache.maven.reporting
+ maven-reporting-impl
+ jar
+ 2.4
+
+
+ org.apache.maven.doxia
+ doxia-decoration-model
+ jar
+ 1.7.4
+
+
+ org.apache.maven
+ maven-core
+ jar
+ 3.3.3
+
+
+ com.google.guava
+ guava
+ jar
+ 20.0
+
+
+ com.google.inject
+ guice
+ jar
+ 4.2.0
+
+
+ aopalliance
+ aopalliance
+ jar
+ 1.0
+
+
+ cglib
+ cglib
+ jar
+ 3.2.0
+
+
+ javax.inject
+ javax.inject
+ jar
+ 1
+
+
+ org.apache.maven.resolver
+ maven-resolver-spi
+ jar
+ 1.1.1
+
+
+ org.apache.maven
+ maven-builder-support
+ jar
+ 3.5.4
+
+
+ org.apache.maven.doxia
+ doxia-core
+ jar
+ 1.7
+
+
+ xmlunit
+ xmlunit
+ jar
+ 1.5
+
+
+ commons-lang
+ commons-lang
+ jar
+ 2.4
+
+
+ org.apache.httpcomponents
+ httpclient
+ jar
+ 4.0.2
+
+
+ commons-logging
+ commons-logging
+ jar
+ SYSTEM
+
+
+ commons-codec
+ commons-codec
+ jar
+ SYSTEM
+
+
+ org.apache.httpcomponents
+ httpcore
+ jar
+ 4.0.1
+
+
+ org.apache.maven.shared
+ maven-shared-utils
+ jar
+ 3.2.1
+
+
+ commons-io
+ commons-io
+ jar
+ 2.5
+
+
+ org.apache.maven.doxia
+ doxia-sink-api
+ jar
+ 1.7
+
+
+ org.apache.maven.doxia
+ doxia-site-renderer
+ jar
+ 1.6
+
+
+ org.apache.maven.doxia
+ doxia-logging-api
+ jar
+ 1.7
+
+
+ commons-collections
+ commons-collections
+ jar
+ 3.2.1
+
+
+ org.codehaus.plexus
+ plexus-velocity
+ jar
+ 1.2
+
+
+ org.codehaus.plexus
+ plexus-i18n
+ jar
+ 1.0-beta-7
+
+
+ org.apache.maven.doxia
+ doxia-module-xhtml
+ jar
+ 1.7
+
+
+ org.codehaus.plexus
+ plexus-container-default
+ jar
+ 1.0-alpha-30
+
+
+ org.ow2.asm
+ asm-commons
+ jar
+ 5.0.3
+
+
+ org.ow2.asm
+ asm-tree
+ jar
+ 6.2.1
+
+
+ org.ow2.asm
+ asm-analysis
+ jar
+ 6.2.1
+
+
+ org.ow2.asm
+ asm
+ jar
+ 5.0.3
+
+
+ org.apache.xbean
+ xbean-reflect
+ jar
+ 3.7
+
+
+ org.apache.velocity
+ velocity
+ jar
+ 1.7
+
+
+ org.codehaus.plexus
+ plexus-component-annotations
+ jar
+ 1.5.5
+
+
+ org.apache.maven.doxia
+ doxia-skin-model
+ jar
+ 1.7.5
+
+
+ org.codehaus.plexus
+ plexus-utils
+ jar
+ 3.0.15
+
+
+
--- surefire-2.22.0/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/HelpMojo.java 1970-01-01 01:00:00.000000000 +0100
+++ surefire-2.22.0/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugins/surefire/report/HelpMojo.java 2019-04-01 16:38:38.246383508 +0200
@@ -0,0 +1,458 @@
+
+package org.apache.maven.plugins.surefire.report;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Display help information on maven-surefire-report-plugin.
+ * Call mvn surefire-report:help -Ddetail=true -Dgoal=<goal-name>
to display parameter details.
+ * @author maven-plugin-tools
+ */
+@Mojo( name = "help", requiresProject = false, threadSafe = true )
+public class HelpMojo
+ extends AbstractMojo
+{
+ /**
+ * If true
, display all settable properties for each goal.
+ *
+ */
+ @Parameter( property = "detail", defaultValue = "false" )
+ private boolean detail;
+
+ /**
+ * The name of the goal for which to show help. If unspecified, all goals will be displayed.
+ *
+ */
+ @Parameter( property = "goal" )
+ private java.lang.String goal;
+
+ /**
+ * The maximum length of a display line, should be positive.
+ *
+ */
+ @Parameter( property = "lineLength", defaultValue = "80" )
+ private int lineLength;
+
+ /**
+ * The number of spaces per indentation level, should be positive.
+ *
+ */
+ @Parameter( property = "indentSize", defaultValue = "2" )
+ private int indentSize;
+
+ // groupId/artifactId/plugin-help.xml
+ private static final String PLUGIN_HELP_PATH =
+ "/META-INF/maven/org.apache.maven.plugins/maven-surefire-report-plugin/plugin-help.xml";
+
+ private static final int DEFAULT_LINE_LENGTH = 80;
+
+ private Document build()
+ throws MojoExecutionException
+ {
+ getLog().debug( "load plugin-help.xml: " + PLUGIN_HELP_PATH );
+ InputStream is = null;
+ try
+ {
+ is = getClass().getResourceAsStream( PLUGIN_HELP_PATH );
+ DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+ return dBuilder.parse( is );
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException( e.getMessage(), e );
+ }
+ catch ( ParserConfigurationException e )
+ {
+ throw new MojoExecutionException( e.getMessage(), e );
+ }
+ catch ( SAXException e )
+ {
+ throw new MojoExecutionException( e.getMessage(), e );
+ }
+ finally
+ {
+ if ( is != null )
+ {
+ try
+ {
+ is.close();
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException( e.getMessage(), e );
+ }
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void execute()
+ throws MojoExecutionException
+ {
+ if ( lineLength <= 0 )
+ {
+ getLog().warn( "The parameter 'lineLength' should be positive, using '80' as default." );
+ lineLength = DEFAULT_LINE_LENGTH;
+ }
+ if ( indentSize <= 0 )
+ {
+ getLog().warn( "The parameter 'indentSize' should be positive, using '2' as default." );
+ indentSize = 2;
+ }
+
+ Document doc = build();
+
+ StringBuilder sb = new StringBuilder();
+ Node plugin = getSingleChild( doc, "plugin" );
+
+
+ String name = getValue( plugin, "name" );
+ String version = getValue( plugin, "version" );
+ String id = getValue( plugin, "groupId" ) + ":" + getValue( plugin, "artifactId" ) + ":" + version;
+ if ( isNotEmpty( name ) && !name.contains( id ) )
+ {
+ append( sb, name + " " + version, 0 );
+ }
+ else
+ {
+ if ( isNotEmpty( name ) )
+ {
+ append( sb, name, 0 );
+ }
+ else
+ {
+ append( sb, id, 0 );
+ }
+ }
+ append( sb, getValue( plugin, "description" ), 1 );
+ append( sb, "", 0 );
+
+ //plugin
+ String goalPrefix = getValue( plugin, "goalPrefix" );
+
+ Node mojos1 = getSingleChild( plugin, "mojos" );
+
+ List mojos = findNamedChild( mojos1, "mojo" );
+
+ if ( goal == null || goal.length() <= 0 )
+ {
+ append( sb, "This plugin has " + mojos.size() + ( mojos.size() > 1 ? " goals:" : " goal:" ), 0 );
+ append( sb, "", 0 );
+ }
+
+ for ( Node mojo : mojos )
+ {
+ writeGoal( sb, goalPrefix, (Element) mojo );
+ }
+
+ if ( getLog().isInfoEnabled() )
+ {
+ getLog().info( sb.toString() );
+ }
+ }
+
+
+ private static boolean isNotEmpty( String string )
+ {
+ return string != null && string.length() > 0;
+ }
+
+ private String getValue( Node node, String elementName )
+ throws MojoExecutionException
+ {
+ return getSingleChild( node, elementName ).getTextContent();
+ }
+
+ private Node getSingleChild( Node node, String elementName )
+ throws MojoExecutionException
+ {
+ List namedChild = findNamedChild( node, elementName );
+ if ( namedChild.isEmpty() )
+ {
+ throw new MojoExecutionException( "Could not find " + elementName + " in plugin-help.xml" );
+ }
+ if ( namedChild.size() > 1 )
+ {
+ throw new MojoExecutionException( "Multiple " + elementName + " in plugin-help.xml" );
+ }
+ return namedChild.get( 0 );
+ }
+
+ private List findNamedChild( Node node, String elementName )
+ {
+ List result = new ArrayList();
+ NodeList childNodes = node.getChildNodes();
+ for ( int i = 0; i < childNodes.getLength(); i++ )
+ {
+ Node item = childNodes.item( i );
+ if ( elementName.equals( item.getNodeName() ) )
+ {
+ result.add( item );
+ }
+ }
+ return result;
+ }
+
+ private Node findSingleChild( Node node, String elementName )
+ throws MojoExecutionException
+ {
+ List elementsByTagName = findNamedChild( node, elementName );
+ if ( elementsByTagName.isEmpty() )
+ {
+ return null;
+ }
+ if ( elementsByTagName.size() > 1 )
+ {
+ throw new MojoExecutionException( "Multiple " + elementName + "in plugin-help.xml" );
+ }
+ return elementsByTagName.get( 0 );
+ }
+
+ private void writeGoal( StringBuilder sb, String goalPrefix, Element mojo )
+ throws MojoExecutionException
+ {
+ String mojoGoal = getValue( mojo, "goal" );
+ Node configurationElement = findSingleChild( mojo, "configuration" );
+ Node description = findSingleChild( mojo, "description" );
+ if ( goal == null || goal.length() <= 0 || mojoGoal.equals( goal ) )
+ {
+ append( sb, goalPrefix + ":" + mojoGoal, 0 );
+ Node deprecated = findSingleChild( mojo, "deprecated" );
+ if ( ( deprecated != null ) && isNotEmpty( deprecated.getTextContent() ) )
+ {
+ append( sb, "Deprecated. " + deprecated.getTextContent(), 1 );
+ if ( detail && description != null )
+ {
+ append( sb, "", 0 );
+ append( sb, description.getTextContent(), 1 );
+ }
+ }
+ else if ( description != null )
+ {
+ append( sb, description.getTextContent(), 1 );
+ }
+ append( sb, "", 0 );
+
+ if ( detail )
+ {
+ Node parametersNode = getSingleChild( mojo, "parameters" );
+ List parameters = findNamedChild( parametersNode, "parameter" );
+ append( sb, "Available parameters:", 1 );
+ append( sb, "", 0 );
+
+ for ( Node parameter : parameters )
+ {
+ writeParameter( sb, parameter, configurationElement );
+ }
+ }
+ }
+ }
+
+ private void writeParameter( StringBuilder sb, Node parameter, Node configurationElement )
+ throws MojoExecutionException
+ {
+ String parameterName = getValue( parameter, "name" );
+ String parameterDescription = getValue( parameter, "description" );
+
+ Element fieldConfigurationElement = null;
+ if ( configurationElement != null )
+ {
+ fieldConfigurationElement = (Element) findSingleChild( configurationElement, parameterName );
+ }
+
+ String parameterDefaultValue = "";
+ if ( fieldConfigurationElement != null && fieldConfigurationElement.hasAttribute( "default-value" ) )
+ {
+ parameterDefaultValue = " (Default: " + fieldConfigurationElement.getAttribute( "default-value" ) + ")";
+ }
+ append( sb, parameterName + parameterDefaultValue, 2 );
+ Node deprecated = findSingleChild( parameter, "deprecated" );
+ if ( ( deprecated != null ) && isNotEmpty( deprecated.getTextContent() ) )
+ {
+ append( sb, "Deprecated. " + deprecated.getTextContent(), 3 );
+ append( sb, "", 0 );
+ }
+ append( sb, parameterDescription, 3 );
+ if ( "true".equals( getValue( parameter, "required" ) ) )
+ {
+ append( sb, "Required: Yes", 3 );
+ }
+ if ( ( fieldConfigurationElement != null ) && isNotEmpty( fieldConfigurationElement.getTextContent() ) )
+ {
+ String property = getPropertyFromExpression( fieldConfigurationElement.getTextContent() );
+ append( sb, "User property: " + property, 3 );
+ }
+
+ append( sb, "", 0 );
+ }
+
+ /**
+ * Repeat a String n
times to form a new string.
+ *
+ * @param str String to repeat
+ * @param repeat number of times to repeat str
+ * @return String with repeated String
+ * @throws NegativeArraySizeException if repeat < 0
+ * @throws NullPointerException if str is null
+ */
+ private static String repeat( String str, int repeat )
+ {
+ StringBuilder buffer = new StringBuilder( repeat * str.length() );
+
+ for ( int i = 0; i < repeat; i++ )
+ {
+ buffer.append( str );
+ }
+
+ return buffer.toString();
+ }
+
+ /**
+ * Append a description to the buffer by respecting the indentSize and lineLength parameters.
+ * Note: The last character is always a new line.
+ *
+ * @param sb The buffer to append the description, not null
.
+ * @param description The description, not null
.
+ * @param indent The base indentation level of each line, must not be negative.
+ */
+ private void append( StringBuilder sb, String description, int indent )
+ {
+ for ( String line : toLines( description, indent, indentSize, lineLength ) )
+ {
+ sb.append( line ).append( '\n' );
+ }
+ }
+
+ /**
+ * Splits the specified text into lines of convenient display length.
+ *
+ * @param text The text to split into lines, must not be null
.
+ * @param indent The base indentation level of each line, must not be negative.
+ * @param indentSize The size of each indentation, must not be negative.
+ * @param lineLength The length of the line, must not be negative.
+ * @return The sequence of display lines, never null
.
+ * @throws NegativeArraySizeException if indent < 0
+ */
+ private static List toLines( String text, int indent, int indentSize, int lineLength )
+ {
+ List lines = new ArrayList();
+
+ String ind = repeat( "\t", indent );
+
+ String[] plainLines = text.split( "(\r\n)|(\r)|(\n)" );
+
+ for ( String plainLine : plainLines )
+ {
+ toLines( lines, ind + plainLine, indentSize, lineLength );
+ }
+
+ return lines;
+ }
+
+ /**
+ * Adds the specified line to the output sequence, performing line wrapping if necessary.
+ *
+ * @param lines The sequence of display lines, must not be null
.
+ * @param line The line to add, must not be null
.
+ * @param indentSize The size of each indentation, must not be negative.
+ * @param lineLength The length of the line, must not be negative.
+ */
+ private static void toLines( List lines, String line, int indentSize, int lineLength )
+ {
+ int lineIndent = getIndentLevel( line );
+ StringBuilder buf = new StringBuilder( 256 );
+
+ String[] tokens = line.split( " +" );
+
+ for ( String token : tokens )
+ {
+ if ( buf.length() > 0 )
+ {
+ if ( buf.length() + token.length() >= lineLength )
+ {
+ lines.add( buf.toString() );
+ buf.setLength( 0 );
+ buf.append( repeat( " ", lineIndent * indentSize ) );
+ }
+ else
+ {
+ buf.append( ' ' );
+ }
+ }
+
+ for ( int j = 0; j < token.length(); j++ )
+ {
+ char c = token.charAt( j );
+ if ( c == '\t' )
+ {
+ buf.append( repeat( " ", indentSize - buf.length() % indentSize ) );
+ }
+ else if ( c == '\u00A0' )
+ {
+ buf.append( ' ' );
+ }
+ else
+ {
+ buf.append( c );
+ }
+ }
+ }
+ lines.add( buf.toString() );
+ }
+
+ /**
+ * Gets the indentation level of the specified line.
+ *
+ * @param line The line whose indentation level should be retrieved, must not be null
.
+ * @return The indentation level of the line.
+ */
+ private static int getIndentLevel( String line )
+ {
+ int level = 0;
+ for ( int i = 0; i < line.length() && line.charAt( i ) == '\t'; i++ )
+ {
+ level++;
+ }
+ for ( int i = level + 1; i <= level + 4 && i < line.length(); i++ )
+ {
+ if ( line.charAt( i ) == '\t' )
+ {
+ level++;
+ break;
+ }
+ }
+ return level;
+ }
+
+ private String getPropertyFromExpression( String expression )
+ {
+ if ( expression != null && expression.startsWith( "${" ) && expression.endsWith( "}" )
+ && !expression.substring( 2 ).contains( "${" ) )
+ {
+ // expression="${xxx}" -> property="xxx"
+ return expression.substring( 2, expression.length() - 1 );
+ }
+ // no property can be extracted
+ return null;
+ }
+}