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 );
+ }
+ if ( isNotEmpty( parameterDescription ) ) {
+ 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 static 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;
+ }
+}
--- /dev/null
+++ b/maven-surefire-plugin/src/main/filtered-resources/META-INF/maven/org.apache.maven.plugins/maven-surefire-plugin/plugin-help.xml
@@ -0,0 +1,897 @@
+
+
+
+
+
+ ${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.plugins.maven_surefire_plugin.HelpMojo
+ java
+ per-lookup
+ once-per-session
+ true
+
+
+ detail
+ boolean
+ false
+ true
+ If true, display all settable properties for each goal.
+
+
+ goal
+ java.lang.String
+ false
+ true
+ The name of the goal for which to show help. If unspecified, all goals will be displayed.
+
+
+ indentSize
+ int
+ false
+ true
+ The number of spaces per indentation level, should be positive.
+
+
+ lineLength
+ int
+ false
+ true
+ The maximum length of a display line, should be positive.
+
+
+
+ ${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
+
+
+ additionalClasspathDependencies
+ java.util.List<org.apache.maven.model.Dependency>
+ 3.2
+ false
+ true
+ Additional Maven dependencies to be added to the test classpath at runtime. Each element supports the parametrization like documented in POM Reference: Dependencies <https://maven.apache.org/pom.html#dependencies>.
+Those dependencies are automatically collected (i.e. have their full dependency tree calculated) and then all underlying artifacts are resolved from the repository (including their transitive dependencies). Afterwards the resolved artifacts are filtered to only contain compile and runtime scoped ones and appended to the test classpath at runtime (after the ones from additionalClasspathElements).
+
+The following differences to regular project dependency resolving apply:
+
+* The dependency management from the project is not taken into account.
+* Conflicts between the different items and the project dependencies are not resolved.
+* Only external dependencies (outside the current Maven reactor) are supported.
+
+
+ additionalClasspathElements
+ java.lang.String[]
+ 2.4
+ false
+ true
+ Additional elements to be appended to the test classpath at runtime. Each element must be a file system path to a JAR file or a directory containing classes. No wildcards are allowed here.
+
+
+ argLine
+ java.lang.String
+ 2.1
+ false
+ true
+ Arbitrary JVM options to set on the command line.
+
+Since the Version 2.17 using an alternate syntax for argLine, @{...} allows late replacement of properties when the plugin is executed, so properties that have been modified by other plugins will be picked up correctly. See the Frequently Asked Questions page with more details:
+http://maven.apache.org/surefire/maven-surefire-plugin/faq.html <http://maven.apache.org/surefire/maven-surefire-plugin/faq.html>
+http://maven.apache.org/surefire/maven-failsafe-plugin/faq.html <http://maven.apache.org/surefire/maven-failsafe-plugin/faq.html>
+
+
+ childDelegation
+ boolean
+ 2.1
+ false
+ true
+ When false it makes tests run using the standard classloader delegation instead of the default Maven isolated classloader. Only used when forking (forkCount is greater than zero).
+Setting it to false helps with some problems caused by conflicts between xml parsers in the classpath and the Java 5 provider parser.
+
+
+ classesDirectory
+ java.io.File
+ false
+ true
+ The directory containing generated classes of the project being tested. This will be included after the test classes in the test classpath.
+
+
+ classpathDependencyExcludes
+ java.lang.String[]
+ 2.6
+ false
+ true
+ List of dependencies to exclude from the test classpath at runtime. Each item is passed as pattern to org.apache.maven.shared.artifact.filter.PatternIncludesArtifactFilter. The pattern is matched against the following artifact ids:
+* groupId:artifactId (Short ID)
+* groupId:artifactId:type:classifier (Dependency Conflict ID)
+* groupId:artifactId:type:classifier:version (Full ID) The matching algorithm is described in detail in Advanced Artifact-Matching <https://maven.apache.org/plugins/maven-assembly-plugin/advanced-descriptor-topics.html#advanced-artifact-matching-in-includes-and-excludes> for the maven-assembly-plugin. This parameter behaves the same as the excludes pattern described there. The dependency matching is applied to the project dependency IDs (including transitive ones) after resolving, i.e. excluding one dependency will not exclude its transitive dependencies!
+
+
+ classpathDependencyScopeExclude
+ java.lang.String
+ 2.6
+ false
+ true
+ A dependency scope to exclude from the test classpath at runtime. The scope should be one of the scopes defined by org.apache.maven.artifact.Artifact. This includes the following:
+
+* compile - system, provided, compile
+* runtime - compile, runtime
+* compile+runtime - system, provided, compile, runtime
+* runtime+system - system, compile, runtime
+* test - system, provided, compile, runtime, test
+
+
+ consoleOutputReporter
+ org.apache.maven.plugin.surefire.extensions.SurefireConsoleOutputReporter
+ false
+ true
+
+
+
+ debugForkedProcess
+ java.lang.String
+ 2.4
+ false
+ true
+ Attach a debugger to the forked JVM. If set to "true", the process will suspend and wait for a debugger to attach on port 5005. If set to some other string, that string will be appended to the argLine, allowing you to configure arbitrary debuggability options (without overwriting the other options specified through the argLine parameter).
+
+
+ dependenciesToScan
+ java.lang.String[]
+ 2.15
+ false
+ true
+ List of dependencies to scan for test classes to include in the test run. The child elements of this element must be <dependency> elements, and the contents of each of these elements must be a string which follows the general form:
+groupId[:artifactId[:type[:classifier][:version]]]
+
+The wildcard character * can be used within the sub parts of those composite identifiers to do glob-like pattern matching. The classifier may be omitted when matching dependencies without a classifier.
+
+Examples:
+
+* group or, equivalently, group:*
+* g*p:*rtifac*
+* group:*:jar
+* group:artifact:*:1.0.0 (no classifier)
+* group:*:test-jar:tests
+* *:artifact:*:*:1.0.0
+Since version 2.22.0 you can scan for test classes from a project dependency of your multi-module project.
+
+In versions before 3.0.0-M4, only groupId:artifactId is supported.
+
+
+
+ disableXmlReport
+ boolean
+ 2.2
+ No reason given
+ false
+ true
+ Flag to disable the generation of report files in xml format. Deprecated since 3.0.0-M4. Instead use disable within statelessTestsetReporter since of 3.0.0-M6.
+
+
+ enableAssertions
+ boolean
+ 2.3.1
+ false
+ true
+ By default, Surefire enables JVM assertions for the execution of your test cases. To disable the assertions, set this flag to "false".
+
+
+ enableProcessChecker
+ java.lang.String
+ 3.0.0-M4
+ false
+ true
+ Since 3.0.0-M4 the process checkers are disabled. You can enable them namely by setting ping and native or all in this parameter.
+The checker is useful in situations when you kill the build on a CI system and you want the Surefire forked JVM to kill the tests asap and free all handlers on the file system been previously used by the JVM and by the tests.
+The ping should be safely used together with ZGC or Shenandoah Garbage Collector. Due to the ping relies on timing of the PING (triggered every 30 seconds), slow GCs may pause the timers and pretend that the parent process of the forked JVM does not exist.
+The native is very fast checker. It is useful mechanism on Unix based systems, Linux distributions and Alpine/BusyBox Linux. See the JIRA SUREFIRE-1631 <https://issues.apache.org/jira/browse/SUREFIRE-1631> for Windows issues.
+Another useful configuration parameter is forkedProcessTimeoutInSeconds.
+See the Frequently Asked Questions page with more details:
+http://maven.apache.org/surefire/maven-surefire-plugin/faq.html#kill-jvm <http://maven.apache.org/surefire/maven-surefire-plugin/faq.html#kill-jvm>
+http://maven.apache.org/surefire/maven-failsafe-plugin/faq.html#kill-jvm <http://maven.apache.org/surefire/maven-failsafe-plugin/faq.html#kill-jvm>
+Example of use:
+mvn test -Dsurefire.enableProcessChecker=all
+
+
+ encoding
+ java.lang.String
+ 3.0.0-M1
+ false
+ true
+ The character encoding scheme to be applied while generating test report files (see target/surefire-reports/yourTestName.txt). The report output files (*-out.txt) are encoded in UTF-8 if not set otherwise.
+
+
+ environmentVariables
+ java.util.Map<java.lang.String, java.lang.String>
+ 2.1.3
+ false
+ true
+ Additional environment variables to set on the command line.
+
+
+ excludedEnvironmentVariables
+ java.lang.String[]
+ 3.0.0-M4
+ false
+ true
+ You can selectively exclude individual environment variables by enumerating their keys.
+The environment is a system-dependent mapping from keys to values which is inherited from the Maven process to the forked Surefire processes. The keys must literally (case sensitive) match in order to exclude their environment variable.
+Example to exclude three environment variables:
+mvn test -Dsurefire.excludedEnvironmentVariables=ACME1,ACME2,ACME3
+
+
+ excludedGroups
+ java.lang.String
+ 2.2
+ false
+ true
+ (TestNG/JUnit47 provider with JUnit4.8+ only and JUnit5+ provider since 2.22.0) Excluded groups/categories/tags. Any methods/classes/etc with one of the groups/categories/tags specified in this list will specifically not be run.
+For JUnit4, this parameter forces the use of the 4.7 provider. For JUnit5, this parameter forces the use of the JUnit platform provider.
+This parameter is ignored if the suiteXmlFiles parameter is specified.
+Since version 2.18.1 and JUnit 4.12, the @Category annotation type is automatically inherited from superclasses, see @java.lang.annotation.Inherited. Make sure that test class inheritance still makes sense together with @Category annotation of the JUnit 4.12 or higher appeared in superclass.
+
+
+ excludeJUnit5Engines
+ java.lang.String[]
+ 3.0.0-M6
+ false
+ true
+ Provide the ID/s of an JUnit engine to be excluded in the test run.
+
+
+ excludes
+ java.util.List<java.lang.String>
+ false
+ true
+ A list of <exclude> elements specifying the tests (by pattern) that should be excluded in testing. When not specified and when the test parameter is not specified, the default excludes will be
+<excludes> <exclude>**/*$*</exclude> </excludes> (which excludes all inner classes).
+This parameter is ignored if the TestNG suiteXmlFiles parameter is specified.
+Each exclude item may also contain a comma-separated sub-list of items, which will be treated as multiple <exclude> entries.
+Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG): <exclude>%regex[pkg.*Slow.*.class], Unstable*</exclude>
+Notice that these values are relative to the directory containing generated test classes of the project being tested. This directory is declared by the parameter testClassesDirectory which defaults to the POM property ${project.build.testOutputDirectory}, typically src/test/java unless overridden.
+
+
+ excludesFile
+ java.io.File
+ 2.13
+ false
+ true
+ A file containing exclude patterns. Blank lines, or lines starting with # are ignored. If excludes are also specified, these patterns are appended. Example with path, simple and regex excludes:
+*/test/* **/DontRunTest.* %regex[.*Test.*|.*Not.*] Since 3.0.0-M6, method filtering support is provided in the exclusions file as well, example: pkg.SomeTest#testMethod
+
+
+ failIfNoSpecifiedTests
+ boolean
+ 2.12
+ false
+ true
+ Set this to "true" to cause a failure if none of the tests specified in -Dtest=... are run. Defaults to "true".
+
+
+ failIfNoTests
+ boolean
+ 2.4
+ false
+ true
+ Set this to "true" to cause a failure if there are no tests to run. Defaults to "false".
+
+
+ failOnFlakeCount
+ int
+ 3.0.0-M6
+ false
+ true
+ Set this to a value greater than 0 to fail the whole test set if the cumulative number of flakes reaches this threshold. Set to 0 to allow an unlimited number of flakes.
+
+
+ forkCount
+ java.lang.String
+ 2.14
+ false
+ true
+ Option to specify the number of VMs to fork in parallel in order to execute the tests. When terminated with "C", the number part is multiplied with the number of CPU cores. Floating point value are only accepted together with "C". If set to "0", no VM is forked and all tests are executed within the main process.
+
+Example values: "1.5C", "4"
+
+The system properties and the argLine of the forked processes may contain the place holder string ${surefire.forkNumber}, which is replaced with a fixed number for each of the parallel forks, ranging from 1 to the effective value of forkCount times the maximum number of parallel Surefire executions in maven parallel builds, i.e. the effective value of the -T command line argument of maven core.
+
+
+ forkedProcessExitTimeoutInSeconds
+ int
+ 2.20
+ false
+ true
+ Forked process is normally terminated without any significant delay after given tests have completed. If the particular tests started non-daemon Thread(s), the process hangs instead of been properly terminated by System.exit(). Use this parameter in order to determine the timeout of terminating the process. see the documentation: http://maven.apache.org/surefire/maven-surefire-plugin/examples/shutdown.html <http://maven.apache.org/surefire/maven-surefire-plugin/examples/shutdown.html> Turns to default fallback value of 30 seconds if negative integer.
+
+
+ forkedProcessTimeoutInSeconds
+ int
+ 2.4
+ false
+ true
+ Kill the forked test process after a certain number of seconds. If set to 0, wait forever for the process, never timing out.
+
+
+ forkNode
+ org.apache.maven.surefire.extensions.ForkNodeFactory
+ 3.0.0-M5
+ false
+ true
+ This parameter configures the forked node. Currently, you can select the communication protocol, i.e. process pipes or TCP/IP sockets. The plugin uses process pipes by default which will be turned to TCP/IP in the version 3.0.0. Alternatively, you can implement your own factory and SPI.
+See the documentation for more details:
+https://maven.apache.org/plugins/maven-surefire-plugin/examples/process-communication.html <https://maven.apache.org/plugins/maven-surefire-plugin/examples/process-communication.html>
+
+
+ groups
+ java.lang.String
+ 2.2
+ false
+ true
+ (TestNG/JUnit47 provider with JUnit4.8+ only and JUnit5+ provider since 2.22.0) Groups/categories/tags for this test. Only classes/methods/etc decorated with one of the groups/categories/tags specified here will be included in test run, if specified.
+For JUnit4 tests, this parameter forces the use of the 4.7 provider. For JUnit5 tests, this parameter forces the use of the JUnit platform provider.
+This parameter is ignored if the suiteXmlFiles parameter is specified.
+Since version 2.18.1 and JUnit 4.12, the @Category annotation type is automatically inherited from superclasses, see @java.lang.annotation.Inherited. Make sure that test class inheritance still makes sense together with @Category annotation of the JUnit 4.12 or higher appeared in superclass.
+
+
+ includeJUnit5Engines
+ java.lang.String[]
+ 3.0.0-M6
+ false
+ true
+ Provide the ID/s of an JUnit engine to be included in the test run.
+
+
+ includes
+ java.util.List<java.lang.String>
+ false
+ true
+ A list of <include> elements specifying the tests (by pattern) that should be included in testing. When not specified and when the test parameter is not specified, the default includes will be <includes> <include>**/Test*.java</include> <include>**/*Test.java</include> <include>**/*Tests.java</include> <include>**/*TestCase.java</include> </includes> Each include item may also contain a comma-separated sub-list of items, which will be treated as multiple <include> entries.
+Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG): <include>%regex[.*[Cat|Dog].*], Basic????, !Unstable*</include> <include>%regex[.*[Cat|Dog].*], !%regex[pkg.*Slow.*.class], pkg/**/*Fast*.java</include>
+This parameter is ignored if the TestNG suiteXmlFiles parameter is specified.
+
+Notice that these values are relative to the directory containing generated test classes of the project being tested. This directory is declared by the parameter testClassesDirectory which defaults to the POM property ${project.build.testOutputDirectory}, typically src/test/java unless overridden.
+
+
+ includesFile
+ java.io.File
+ 2.13
+ false
+ true
+ A file containing include patterns. Blank lines, or lines starting with # are ignored. If includes are also specified, these patterns are appended. Example with path, simple and regex includes: */test/* **/NotIncludedByDefault.java %regex[.*Test.*|.*Not.*]
+Since 3.0.0-M6, method filtering support is provided in the inclusions file as well, example: pkg.SomeTest#testMethod
+
+
+ jdkToolchain
+ java.util.Map<java.lang.String, java.lang.String>
+ 3.0.0-M5 and Maven 3.3.x
+ false
+ true
+
+Allow for configuration of the test jvm via maven toolchains. This permits a configuration where the project is built with one jvm and tested with another. This is similar to jvm, but avoids hardcoding paths. The two parameters are mutually exclusive (jvm wins)
+
+Examples:
+(see Guide to Toolchains <https://maven.apache.org/guides/mini/guide-using-toolchains.html> for more info) <configuration> ... <jdkToolchain> <version>1.11</version> </jdkToolchain> </configuration> <configuration> ... <jdkToolchain> <version>1.8</version> <vendor>zulu</vendor> </jdkToolchain> </configuration>
+
+
+ junitArtifactName
+ java.lang.String
+ 2.3.1
+ false
+ true
+ Allows you to specify the name of the JUnit artifact. If not set, junit:junit will be used.
+
+
+ jvm
+ java.lang.String
+ 2.1
+ false
+ true
+ Option to specify the jvm (or path to the java executable) to use with the forking options. For the default, the jvm will be a new instance of the same VM as the one used to run Maven. JVM settings are not inherited from MAVEN_OPTS.
+
+
+ objectFactory
+ java.lang.String
+ 2.5
+ false
+ true
+ (TestNG only) Define the factory class used to create all test instances.
+
+
+ parallel
+ java.lang.String
+ 2.2
+ false
+ true
+ (TestNG provider) When you use the parameter parallel, TestNG will try to run all your test methods in separate threads, except for methods that depend on each other, which will be run in the same thread in order to respect their order of execution. Supports two values: classes or methods.
+(JUnit 4.7 provider) Supports values classes, methods, both to run in separate threads been controlled by threadCount.
+
+Since version 2.16 (JUnit 4.7 provider), the value both is DEPRECATED. Use classesAndMethods instead.
+
+Since version 2.16 (JUnit 4.7 provider), additional vales are available:
+suites, suitesAndClasses, suitesAndMethods, classesAndMethods, all.
+By default, Surefire does not execute tests in parallel. You can set the parameter parallel to none to explicitly disable parallel execution (e.g. when disabling parallel execution in special Maven profiles when executing coverage analysis).
+
+
+ parallelOptimized
+ boolean
+ 2.17
+ false
+ true
+ (JUnit 4.7 / provider only) The thread counts do not exceed the number of parallel suite, class runners and average number of methods per class if set to true.
+True by default.
+
+
+ parallelTestsTimeoutForcedInSeconds
+ double
+ 2.16
+ false
+ true
+ Stop executing queued parallel JUnit tests and interrupt currently running tests after a certain number of seconds.
+Example values: "3.5", "4"
+
+If set to 0, wait forever, never timing out. Makes sense with specified parallel different from "none".
+
+
+ parallelTestsTimeoutInSeconds
+ double
+ 2.16
+ false
+ true
+ Stop executing queued parallel JUnit tests after a certain number of seconds.
+Example values: "3.5", "4"
+
+If set to 0, wait forever, never timing out. Makes sense with specified parallel different from "none".
+
+
+ perCoreThreadCount
+ boolean
+ 2.5
+ false
+ true
+ (JUnit 4.7 provider) Indicates that threadCount, threadCountSuites, threadCountClasses, threadCountMethods are per cpu core.
+
+
+ printSummary
+ boolean
+ false
+ true
+ Option to print summary of test suites or just print the test cases that have errors.
+
+
+ properties
+ java.util.Properties
+ 2.4
+ false
+ true
+ List of properties for configuring all TestNG related configurations. This is the new preferred method of configuring TestNG.
+
+
+ redirectTestOutputToFile
+ boolean
+ 2.3
+ false
+ true
+ Set this to "true" to redirect the unit test standard output to a file (found in reportsDirectory/testName-output.txt).
+
+
+ reportFormat
+ java.lang.String
+ false
+ true
+ Selects the formatting for the test report to be generated. Can be set as "brief" or "plain". Only applies to the output format of the output files (target/surefire-reports/testName.txt)
+
+
+ reportNameSuffix
+ java.lang.String
+ false
+ true
+ Add custom text into report filename: TEST-testClassName-reportNameSuffix.xml, testClassName-reportNameSuffix.txt and testClassName-reportNameSuffix-output.txt. File TEST-testClassName-reportNameSuffix.xml has changed attributes 'testsuite'--'name' and 'testcase'--'classname' - reportNameSuffix is added to the attribute value.
+
+
+ reportsDirectory
+ java.io.File
+ false
+ true
+ Base directory where all reports are written to.
+
+
+ rerunFailingTestsCount
+ int
+ false
+ true
+ (JUnit 4+ providers and JUnit 5+ providers since 3.0.0-M4) The number of times each failing test will be rerun. If set larger than 0, rerun failing tests immediately after they fail. If a failing test passes in any of those reruns, it will be marked as pass and reported as a "flake". However, all the failing attempts will be recorded.
+
+
+ reuseForks
+ boolean
+ 2.13
+ false
+ true
+ Indicates if forked VMs can be reused. If set to "false", a new VM is forked for each test class to be executed. If set to "true", up to forkCount VMs will be forked and then reused to execute all tests.
+
+
+ runOrder
+ java.lang.String
+ 2.7
+ false
+ true
+ Defines the order the tests will be run in. Supported values are alphabetical, reversealphabetical, random, hourly (alphabetical on even hours, reverse alphabetical on odd hours), failedfirst, balanced and filesystem.
+
+Odd/Even for hourly is determined at the time the of scanning the classpath, meaning it could change during a multi-module build.
+
+Failed first will run tests that failed on previous run first, as well as new tests for this run.
+
+Balanced is only relevant with parallel=classes, and will try to optimize the run-order of the tests reducing the overall execution time. Initially a statistics file is created and every next test run will reorder classes.
+
+Note that the statistics are stored in a file named .surefire-XXXXXXXXX beside pom.xml and should not be checked into version control. The "XXXXX" is the SHA1 checksum of the entire surefire configuration, so different configurations will have different statistics files, meaning if you change any configuration settings you will re-run once before new statistics data can be established.
+
+
+ runOrderRandomSeed
+ java.lang.Long
+ 3.0.0-M6
+ false
+ true
+ Sets the random seed that will be used to order the tests if surefire.runOrder is set to random.
+
+If no seeds are set and surefire.runOrder is set to random, then the seed used will be outputted (search for "To reproduce ordering use flag -Dsurefire.runOrder.random.seed").
+
+To deterministically reproduce any random test order that was run before, simply set the seed to be the same value.
+
+
+ shutdown
+ java.lang.String
+ 2.19
+ false
+ true
+ After the plugin process is shutdown by sending SIGTERM signal (CTRL+C), SHUTDOWN command is received by every forked JVM.
+The value is set to (shutdown=exit) by default (changed in version 3.0.0-M4).
+The parameter can be configured with other two values testset and kill.
+With(shutdown=testset) the test set may still continue to run in forked JVM.
+Using exit forked JVM executes System.exit(1) after the plugin process has received SIGTERM signal.
+Using kill the JVM executes Runtime.halt(1) and kills itself.
+
+
+ skip
+ boolean
+ false
+ true
+ Set this to "true" to bypass unit tests entirely. Its use is NOT RECOMMENDED, especially if you enable it using the "maven.test.skip" property, because maven.test.skip disables both running the tests and compiling the tests. Consider using the skipTests parameter instead.
+
+
+ skipAfterFailureCount
+ int
+ 2.19
+ false
+ true
+ Set to error/failure count in order to skip remaining tests. Due to race conditions in parallel/forked execution this may not be fully guaranteed.
+Enable with system property -Dsurefire.skipAfterFailureCount=1 or any number greater than zero. Defaults to "0".
+See the prerequisites and limitations in documentation:
+http://maven.apache.org/plugins/maven-surefire-plugin/examples/skip-after-failure.html <http://maven.apache.org/plugins/maven-surefire-plugin/examples/skip-after-failure.html>
+
+
+ skipExec
+ boolean
+ 2.3
+ Use skipTests instead.
+ false
+ true
+ This old parameter is just like skipTests, but bound to the old property "maven.test.skip.exec".
+
+
+ skipTests
+ boolean
+ 2.4
+ false
+ true
+ Set this to "true" to skip running tests, but still compile them. Its use is NOT RECOMMENDED, but quite convenient on occasion.
+Failsafe plugin deprecated the parameter skipTests and the parameter will be removed in Failsafe 3.0.0 as it is a source of conflicts between Failsafe and Surefire plugin.
+
+
+ statelessTestsetInfoReporter
+ org.apache.maven.plugin.surefire.extensions.SurefireStatelessTestsetInfoReporter
+ false
+ true
+
+
+
+ statelessTestsetReporter
+ org.apache.maven.plugin.surefire.extensions.SurefireStatelessReporter
+ false
+ true
+ Note: use the legacy system property disableXmlReport set to true to disable the report.
+
+
+ suiteXmlFiles
+ java.io.File[]
+ 2.2
+ false
+ true
+ (TestNG) List of <suiteXmlFile> elements specifying TestNG suite xml file locations. Note that suiteXmlFiles is incompatible with several other parameters of this plugin, like includes and excludes.
+This parameter is ignored if the test parameter is specified (allowing you to run a single test instead of an entire suite).
+
+
+ systemProperties
+ java.util.Properties
+ Use systemPropertyVariables instead.
+ false
+ true
+ List of System properties to pass to a provider.
+
+
+ systemPropertiesFile
+ java.io.File
+ false
+ true
+
+
+
+ systemPropertyVariables
+ java.util.Map<java.lang.String, java.lang.String>
+ 2.5
+ false
+ true
+ List of System properties to pass to a provider.
+
+
+ tempDir
+ java.lang.String
+ 2.20
+ false
+ true
+ Relative path to temporary-surefire-boot directory containing internal Surefire temporary files.
+The temporary-surefire-boot directory is project.build.directory on most platforms or system default temporary-directory specified by the system property java.io.tmpdir on Windows (see SUREFIRE-1400 <https://issues.apache.org/jira/browse/SUREFIRE-1400>).
+It is deleted after the test set has completed.
+
+
+ test
+ java.lang.String
+ false
+ true
+ Specify this parameter to run individual tests by file name, overriding the parameter includes and excludes. Each pattern you specify here will be used to create an include pattern formatted like **/${test}.java, so you can just type -Dtest=MyTest to run a single test called "foo/MyTest.java". The test patterns prefixed with a ! will be excluded.
+This parameter overrides the parameter includes, excludes, and the TestNG parameter suiteXmlFiles.
+Since 2.7.3, you can execute a limited number of methods in the test by adding #myMethod or #my*ethod. For example, -Dtest=MyTest#myMethod. This is supported for junit 4.x and TestNg.
+
+Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG): "-Dtest=???Test, !Unstable*, pkg/**/Ci*leTest.java, *Test#test*One+testTwo?????, #fast*+slowTest" or e.g. "-Dtest=Basic*, !%regex[.*.Unstable.*], !%regex[.*.MyTest.class#one.*|two.*], %regex[#fast.*|slow.*]"
+The Parameterized JUnit runner describes test methods using an index in brackets, so the non-regex method pattern would become: #testMethod[*]. If using @Parameters(name="{index}: fib({0})={1}") and selecting the index e.g. 5 in pattern, the non-regex method pattern would become #testMethod[5:*].
+
+
+ testClassesDirectory
+ java.io.File
+ false
+ true
+ The directory containing generated test classes of the project being tested. This will be included at the beginning of the test classpath.
+
+
+ testFailureIgnore
+ boolean
+ false
+ true
+ Set this to "true" to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion.
+
+
+ testNGArtifactName
+ java.lang.String
+ 2.3.1
+ false
+ true
+ Allows you to specify the name of the TestNG artifact. If not set, org.testng:testng will be used.
+
+
+ testSourceDirectory
+ java.io.File
+ 2.2
+ false
+ true
+ The test source directory containing test class sources. Important only for TestNG HTML reports.
+
+
+ threadCount
+ int
+ 2.2
+ false
+ true
+ (TestNG/JUnit 4.7 provider) The attribute thread-count allows you to specify how many threads should be allocated for this execution. Only makes sense to use in conjunction with the parallel parameter.
+
+
+ threadCountClasses
+ int
+ 2.16
+ false
+ true
+ (JUnit 4.7 provider) This attribute allows you to specify the concurrency in test classes, i.e.:
+* number of concurrent classes if threadCount is 0 or unspecified
+* limited classes concurrency if useUnlimitedThreads is set to true
+* if threadCount and certain thread-count parameters are > 0 for parallel, the concurrency is computed from ratio. For instance parallel=all and the ratio between threadCountSuites:threadCountClasses:threadCountMethods is 2:3:5, there is 30% of threadCount in concurrent classes.
+* as in the previous case but without this leaf thread-count. Example: parallel=suitesAndClasses, threadCount=16, threadCountSuites=5, threadCountClasses is unspecified leaf, the number of concurrent classes is varying from >= 11 to 14 or 15. The threadCountSuites become given number of threads. Only makes sense to use in conjunction with the parallel parameter. The default value 0 behaves same as unspecified one.
+
+
+ threadCountMethods
+ int
+ 2.16
+ false
+ true
+ (JUnit 4.7 provider) This attribute allows you to specify the concurrency in test methods, i.e.:
+* number of concurrent methods if threadCount is 0 or unspecified
+* limited concurrency of methods if useUnlimitedThreads is set to true
+* if threadCount and certain thread-count parameters are > 0 for parallel, the concurrency is computed from ratio. For instance parallel=all and the ratio between threadCountSuites:threadCountClasses:threadCountMethods is 2:3:5, there is 50% of threadCount which appears in concurrent methods.
+* as in the previous case but without this leaf thread-count. Example: parallel=all, threadCount=16, threadCountSuites=2, threadCountClasses=3, but threadCountMethods is unspecified leaf, the number of concurrent methods is varying from >= 11 to 14 or 15. The threadCountSuites and threadCountClasses become given number of threads. Only makes sense to use in conjunction with the parallel parameter. The default value 0 behaves same as unspecified one.
+
+
+ threadCountSuites
+ int
+ 2.16
+ false
+ true
+ (JUnit 4.7 provider) This attribute allows you to specify the concurrency in test suites, i.e.:
+* number of concurrent suites if threadCount is 0 or unspecified
+* limited suites concurrency if useUnlimitedThreads is set to true
+* if threadCount and certain thread-count parameters are > 0 for parallel, the concurrency is computed from ratio. For instance parallel=all and the ratio between threadCountSuites:threadCountClasses:threadCountMethods is 2:3:5, there is 20% of threadCount which appeared in concurrent suites. Only makes sense to use in conjunction with the parallel parameter. The default value 0 behaves same as unspecified one.
+
+
+ trimStackTrace
+ boolean
+ 2.2
+ false
+ true
+ Whether to trim the stack trace in the reports to just the lines within the test, or show the full trace.
+
+
+ useFile
+ boolean
+ false
+ true
+ Option to generate a file test report or just output the test report to the console.
+
+
+ useManifestOnlyJar
+ boolean
+ 2.4.3
+ false
+ true
+ By default, Surefire forks your tests using a manifest-only JAR; set this parameter to "false" to force it to launch your tests with a plain old Java classpath. (See the http://maven.apache.org/plugins/maven-surefire-plugin/examples/class-loading.html <http://maven.apache.org/plugins/maven-surefire-plugin/examples/class-loading.html> for a more detailed explanation of manifest-only JARs and their benefits.)
+Beware, setting this to "false" may cause your tests to fail on Windows if your classpath is too long.
+
+
+ useModulePath
+ boolean
+ 3.0.0-M2
+ false
+ true
+ When true, uses the modulepath when executing with JDK 9+ and module-info.java is present. When false, always uses the classpath.
+Defaults to true.
+
+
+ useSystemClassLoader
+ boolean
+ 2.3
+ false
+ true
+ Option to pass dependencies to the system's classloader instead of using an isolated class loader when forking. Prevents problems with JDKs which implement the service provider lookup mechanism by using the system's ClassLoader.
+
+
+ useUnlimitedThreads
+ boolean
+ 2.5
+ false
+ true
+ (JUnit 4.7 provider) Indicates that the thread pool will be unlimited. The parallel parameter and the actual number of classes/methods will decide. Setting this to "true" effectively disables perCoreThreadCount and threadCount. Defaults to "false".
+
+
+ workingDirectory
+ java.io.File
+ 2.1.3
+ false
+ true
+ Command line working directory.
+
+
+
+ ${maven.test.additionalClasspathDependencies}
+ ${maven.test.additionalClasspath}
+ ${argLine}
+ ${childDelegation}
+
+ ${maven.test.dependency.excludes}
+ ${maven.surefire.debug}
+ ${dependenciesToScan}
+ ${disableXmlReport}
+ ${enableAssertions}
+ ${surefire.enableProcessChecker}
+ ${surefire.encoding}
+ ${surefire.excludedEnvironmentVariables}
+ ${excludedGroups}
+ ${surefire.excludeJUnit5Engines}
+ ${surefire.excludes}
+ ${surefire.excludesFile}
+ ${surefire.failIfNoSpecifiedTests}
+ ${failIfNoTests}
+ ${surefire.failOnFlakeCount}
+ ${forkCount}
+ ${surefire.exitTimeout}
+ ${surefire.timeout}
+ ${surefire.forkNode}
+ ${groups}
+ ${surefire.includeJUnit5Engines}
+ ${surefire.includes}
+ ${surefire.includesFile}
+ ${junitArtifactName}
+ ${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.runOrder.random.seed}
+ ${surefire.shutdown}
+ ${maven.test.skip}
+ ${surefire.skipAfterFailureCount}
+ ${maven.test.skip.exec}
+ ${skipTests}
+ ${surefire.suiteXmlFiles}
+ ${surefire.systemPropertiesFile}
+ ${tempDir}
+ ${test}
+
+ ${maven.test.failure.ignore}
+ ${testNGArtifactName}
+
+ ${threadCount}
+ ${threadCountClasses}
+ ${threadCountMethods}
+ ${threadCountSuites}
+ ${trimStackTrace}
+ ${surefire.useFile}
+ ${surefire.useManifestOnlyJar}
+ ${surefire.useModulePath}
+ ${surefire.useSystemClassLoader}
+ ${useUnlimitedThreads}
+ ${basedir}
+
+
+
+
\ No newline at end of file
--- /dev/null
+++ b/maven-surefire-plugin/src/main/filtered-resources/META-INF/maven/plugin.xml
@@ -0,0 +1,1099 @@
+
+
+
+
+
+ ${project.name}
+ ${project.description}
+ ${project.groupId}
+ ${project.artifactId}
+ ${project.version}
+ surefire
+ false
+ true
+ 1.8
+ 3.2.5
+
+
+ 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.plugins.maven_surefire_plugin.HelpMojo
+ java
+ per-lookup
+ once-per-session
+ true
+
+
+ detail
+ boolean
+ false
+ true
+ If true, display all settable properties for each goal.
+
+
+ goal
+ java.lang.String
+ false
+ true
+ The name of the goal for which to show help. If unspecified, all goals will be displayed.
+
+
+ indentSize
+ int
+ false
+ true
+ The number of spaces per indentation level, should be positive.
+
+
+ lineLength
+ int
+ false
+ true
+ The maximum length of a display line, should be positive.
+
+
+
+ ${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
+
+
+ additionalClasspathDependencies
+ java.util.List
+ 3.2
+ false
+ true
+ Additional Maven dependencies to be added to the test classpath at runtime. Each element supports the parametrization like documented in POM Reference: Dependencies <https://maven.apache.org/pom.html#dependencies>.
+Those dependencies are automatically collected (i.e. have their full dependency tree calculated) and then all underlying artifacts are resolved from the repository (including their transitive dependencies). Afterwards the resolved artifacts are filtered to only contain compile and runtime scoped ones and appended to the test classpath at runtime (after the ones from additionalClasspathElements).
+
+The following differences to regular project dependency resolving apply:
+
+* The dependency management from the project is not taken into account.
+* Conflicts between the different items and the project dependencies are not resolved.
+* Only external dependencies (outside the current Maven reactor) are supported.
+
+
+ additionalClasspathElements
+ java.lang.String[]
+ 2.4
+ false
+ true
+ Additional elements to be appended to the test classpath at runtime. Each element must be a file system path to a JAR file or a directory containing classes. No wildcards are allowed here.
+
+
+ argLine
+ java.lang.String
+ 2.1
+ false
+ true
+ Arbitrary JVM options to set on the command line.
+
+Since the Version 2.17 using an alternate syntax for argLine, @{...} allows late replacement of properties when the plugin is executed, so properties that have been modified by other plugins will be picked up correctly. See the Frequently Asked Questions page with more details:
+http://maven.apache.org/surefire/maven-surefire-plugin/faq.html <http://maven.apache.org/surefire/maven-surefire-plugin/faq.html>
+http://maven.apache.org/surefire/maven-failsafe-plugin/faq.html <http://maven.apache.org/surefire/maven-failsafe-plugin/faq.html>
+
+
+ basedir
+ java.io.File
+ true
+ false
+ The base directory of the project being tested. This can be obtained in your integration test via System.getProperty("basedir").
+
+
+ childDelegation
+ boolean
+ 2.1
+ false
+ true
+ When false it makes tests run using the standard classloader delegation instead of the default Maven isolated classloader. Only used when forking (forkCount is greater than zero).
+Setting it to false helps with some problems caused by conflicts between xml parsers in the classpath and the Java 5 provider parser.
+
+
+ classesDirectory
+ java.io.File
+ false
+ true
+ The directory containing generated classes of the project being tested. This will be included after the test classes in the test classpath.
+
+
+ classpathDependencyExcludes
+ java.lang.String[]
+ 2.6
+ false
+ true
+ List of dependencies to exclude from the test classpath at runtime. Each item is passed as pattern to org.apache.maven.shared.artifact.filter.PatternIncludesArtifactFilter. The pattern is matched against the following artifact ids:
+* groupId:artifactId (Short ID)
+* groupId:artifactId:type:classifier (Dependency Conflict ID)
+* groupId:artifactId:type:classifier:version (Full ID) The matching algorithm is described in detail in Advanced Artifact-Matching <https://maven.apache.org/plugins/maven-assembly-plugin/advanced-descriptor-topics.html#advanced-artifact-matching-in-includes-and-excludes> for the maven-assembly-plugin. This parameter behaves the same as the excludes pattern described there. The dependency matching is applied to the project dependency IDs (including transitive ones) after resolving, i.e. excluding one dependency will not exclude its transitive dependencies!
+
+
+ classpathDependencyScopeExclude
+ java.lang.String
+ 2.6
+ false
+ true
+ A dependency scope to exclude from the test classpath at runtime. The scope should be one of the scopes defined by org.apache.maven.artifact.Artifact. This includes the following:
+
+* compile - system, provided, compile
+* runtime - compile, runtime
+* compile+runtime - system, provided, compile, runtime
+* runtime+system - system, compile, runtime
+* test - system, provided, compile, runtime, test
+
+
+ consoleOutputReporter
+ org.apache.maven.plugin.surefire.extensions.SurefireConsoleOutputReporter
+ false
+ true
+
+
+
+ debugForkedProcess
+ java.lang.String
+ 2.4
+ false
+ true
+ Attach a debugger to the forked JVM. If set to "true", the process will suspend and wait for a debugger to attach on port 5005. If set to some other string, that string will be appended to the argLine, allowing you to configure arbitrary debuggability options (without overwriting the other options specified through the argLine parameter).
+
+
+ dependenciesToScan
+ java.lang.String[]
+ 2.15
+ false
+ true
+ List of dependencies to scan for test classes to include in the test run. The child elements of this element must be <dependency> elements, and the contents of each of these elements must be a string which follows the general form:
+groupId[:artifactId[:type[:classifier][:version]]]
+
+The wildcard character * can be used within the sub parts of those composite identifiers to do glob-like pattern matching. The classifier may be omitted when matching dependencies without a classifier.
+
+Examples:
+
+* group or, equivalently, group:*
+* g*p:*rtifac*
+* group:*:jar
+* group:artifact:*:1.0.0 (no classifier)
+* group:*:test-jar:tests
+* *:artifact:*:*:1.0.0
+Since version 2.22.0 you can scan for test classes from a project dependency of your multi-module project.
+
+In versions before 3.0.0-M4, only groupId:artifactId is supported.
+
+
+
+ disableXmlReport
+ boolean
+ 2.2
+ No reason given
+ false
+ true
+ Flag to disable the generation of report files in xml format. Deprecated since 3.0.0-M4. Instead use disable within statelessTestsetReporter since of 3.0.0-M6.
+
+
+ enableAssertions
+ boolean
+ 2.3.1
+ false
+ true
+ By default, Surefire enables JVM assertions for the execution of your test cases. To disable the assertions, set this flag to "false".
+
+
+ enableProcessChecker
+ java.lang.String
+ 3.0.0-M4
+ false
+ true
+ Since 3.0.0-M4 the process checkers are disabled. You can enable them namely by setting ping and native or all in this parameter.
+The checker is useful in situations when you kill the build on a CI system and you want the Surefire forked JVM to kill the tests asap and free all handlers on the file system been previously used by the JVM and by the tests.
+The ping should be safely used together with ZGC or Shenandoah Garbage Collector. Due to the ping relies on timing of the PING (triggered every 30 seconds), slow GCs may pause the timers and pretend that the parent process of the forked JVM does not exist.
+The native is very fast checker. It is useful mechanism on Unix based systems, Linux distributions and Alpine/BusyBox Linux. See the JIRA SUREFIRE-1631 <https://issues.apache.org/jira/browse/SUREFIRE-1631> for Windows issues.
+Another useful configuration parameter is forkedProcessTimeoutInSeconds.
+See the Frequently Asked Questions page with more details:
+http://maven.apache.org/surefire/maven-surefire-plugin/faq.html#kill-jvm <http://maven.apache.org/surefire/maven-surefire-plugin/faq.html#kill-jvm>
+http://maven.apache.org/surefire/maven-failsafe-plugin/faq.html#kill-jvm <http://maven.apache.org/surefire/maven-failsafe-plugin/faq.html#kill-jvm>
+Example of use:
+mvn test -Dsurefire.enableProcessChecker=all
+
+
+ encoding
+ java.lang.String
+ 3.0.0-M1
+ false
+ true
+ The character encoding scheme to be applied while generating test report files (see target/surefire-reports/yourTestName.txt). The report output files (*-out.txt) are encoded in UTF-8 if not set otherwise.
+
+
+ environmentVariables
+ java.util.Map
+ 2.1.3
+ false
+ true
+ Additional environment variables to set on the command line.
+
+
+ excludeJUnit5Engines
+ java.lang.String[]
+ 3.0.0-M6
+ false
+ true
+ Provide the ID/s of an JUnit engine to be excluded in the test run.
+
+
+ excludedEnvironmentVariables
+ java.lang.String[]
+ 3.0.0-M4
+ false
+ true
+ You can selectively exclude individual environment variables by enumerating their keys.
+The environment is a system-dependent mapping from keys to values which is inherited from the Maven process to the forked Surefire processes. The keys must literally (case sensitive) match in order to exclude their environment variable.
+Example to exclude three environment variables:
+mvn test -Dsurefire.excludedEnvironmentVariables=ACME1,ACME2,ACME3
+
+
+ excludedGroups
+ java.lang.String
+ 2.2
+ false
+ true
+ (TestNG/JUnit47 provider with JUnit4.8+ only and JUnit5+ provider since 2.22.0) Excluded groups/categories/tags. Any methods/classes/etc with one of the groups/categories/tags specified in this list will specifically not be run.
+For JUnit4, this parameter forces the use of the 4.7 provider. For JUnit5, this parameter forces the use of the JUnit platform provider.
+This parameter is ignored if the suiteXmlFiles parameter is specified.
+Since version 2.18.1 and JUnit 4.12, the @Category annotation type is automatically inherited from superclasses, see @java.lang.annotation.Inherited. Make sure that test class inheritance still makes sense together with @Category annotation of the JUnit 4.12 or higher appeared in superclass.
+
+
+ excludes
+ java.util.List
+ false
+ true
+ A list of <exclude> elements specifying the tests (by pattern) that should be excluded in testing. When not specified and when the test parameter is not specified, the default excludes will be
+<excludes> <exclude>**/*$*</exclude> </excludes> (which excludes all inner classes).
+This parameter is ignored if the TestNG suiteXmlFiles parameter is specified.
+Each exclude item may also contain a comma-separated sub-list of items, which will be treated as multiple <exclude> entries.
+Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG): <exclude>%regex[pkg.*Slow.*.class], Unstable*</exclude>
+Notice that these values are relative to the directory containing generated test classes of the project being tested. This directory is declared by the parameter testClassesDirectory which defaults to the POM property ${project.build.testOutputDirectory}, typically src/test/java unless overridden.
+
+
+ excludesFile
+ java.io.File
+ 2.13
+ false
+ true
+ A file containing exclude patterns. Blank lines, or lines starting with # are ignored. If excludes are also specified, these patterns are appended. Example with path, simple and regex excludes:
+*/test/* **/DontRunTest.* %regex[.*Test.*|.*Not.*] Since 3.0.0-M6, method filtering support is provided in the exclusions file as well, example: pkg.SomeTest#testMethod
+
+
+ failIfNoSpecifiedTests
+ boolean
+ 2.12
+ false
+ true
+ Set this to "true" to cause a failure if none of the tests specified in -Dtest=... are run. Defaults to "true".
+
+
+ failIfNoTests
+ boolean
+ 2.4
+ false
+ true
+ Set this to "true" to cause a failure if there are no tests to run. Defaults to "false".
+
+
+ failOnFlakeCount
+ int
+ 3.0.0-M6
+ false
+ true
+ Set this to a value greater than 0 to fail the whole test set if the cumulative number of flakes reaches this threshold. Set to 0 to allow an unlimited number of flakes.
+
+
+ forkCount
+ java.lang.String
+ 2.14
+ false
+ true
+ Option to specify the number of VMs to fork in parallel in order to execute the tests. When terminated with "C", the number part is multiplied with the number of CPU cores. Floating point value are only accepted together with "C". If set to "0", no VM is forked and all tests are executed within the main process.
+
+Example values: "1.5C", "4"
+
+The system properties and the argLine of the forked processes may contain the place holder string ${surefire.forkNumber}, which is replaced with a fixed number for each of the parallel forks, ranging from 1 to the effective value of forkCount times the maximum number of parallel Surefire executions in maven parallel builds, i.e. the effective value of the -T command line argument of maven core.
+
+
+ forkNode
+ org.apache.maven.surefire.extensions.ForkNodeFactory
+ 3.0.0-M5
+ false
+ true
+ This parameter configures the forked node. Currently, you can select the communication protocol, i.e. process pipes or TCP/IP sockets. The plugin uses process pipes by default which will be turned to TCP/IP in the version 3.0.0. Alternatively, you can implement your own factory and SPI.
+See the documentation for more details:
+https://maven.apache.org/plugins/maven-surefire-plugin/examples/process-communication.html <https://maven.apache.org/plugins/maven-surefire-plugin/examples/process-communication.html>
+
+
+ forkedProcessExitTimeoutInSeconds
+ int
+ 2.20
+ false
+ true
+ Forked process is normally terminated without any significant delay after given tests have completed. If the particular tests started non-daemon Thread(s), the process hangs instead of been properly terminated by System.exit(). Use this parameter in order to determine the timeout of terminating the process. see the documentation: http://maven.apache.org/surefire/maven-surefire-plugin/examples/shutdown.html <http://maven.apache.org/surefire/maven-surefire-plugin/examples/shutdown.html> Turns to default fallback value of 30 seconds if negative integer.
+
+
+ forkedProcessTimeoutInSeconds
+ int
+ 2.4
+ false
+ true
+ Kill the forked test process after a certain number of seconds. If set to 0, wait forever for the process, never timing out.
+
+
+ groups
+ java.lang.String
+ 2.2
+ false
+ true
+ (TestNG/JUnit47 provider with JUnit4.8+ only and JUnit5+ provider since 2.22.0) Groups/categories/tags for this test. Only classes/methods/etc decorated with one of the groups/categories/tags specified here will be included in test run, if specified.
+For JUnit4 tests, this parameter forces the use of the 4.7 provider. For JUnit5 tests, this parameter forces the use of the JUnit platform provider.
+This parameter is ignored if the suiteXmlFiles parameter is specified.
+Since version 2.18.1 and JUnit 4.12, the @Category annotation type is automatically inherited from superclasses, see @java.lang.annotation.Inherited. Make sure that test class inheritance still makes sense together with @Category annotation of the JUnit 4.12 or higher appeared in superclass.
+
+
+ includeJUnit5Engines
+ java.lang.String[]
+ 3.0.0-M6
+ false
+ true
+ Provide the ID/s of an JUnit engine to be included in the test run.
+
+
+ includes
+ java.util.List
+ false
+ true
+ A list of <include> elements specifying the tests (by pattern) that should be included in testing. When not specified and when the test parameter is not specified, the default includes will be <includes> <include>**/Test*.java</include> <include>**/*Test.java</include> <include>**/*Tests.java</include> <include>**/*TestCase.java</include> </includes> Each include item may also contain a comma-separated sub-list of items, which will be treated as multiple <include> entries.
+Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG): <include>%regex[.*[Cat|Dog].*], Basic????, !Unstable*</include> <include>%regex[.*[Cat|Dog].*], !%regex[pkg.*Slow.*.class], pkg/**/*Fast*.java</include>
+This parameter is ignored if the TestNG suiteXmlFiles parameter is specified.
+
+Notice that these values are relative to the directory containing generated test classes of the project being tested. This directory is declared by the parameter testClassesDirectory which defaults to the POM property ${project.build.testOutputDirectory}, typically src/test/java unless overridden.
+
+
+ includesFile
+ java.io.File
+ 2.13
+ false
+ true
+ A file containing include patterns. Blank lines, or lines starting with # are ignored. If includes are also specified, these patterns are appended. Example with path, simple and regex includes: */test/* **/NotIncludedByDefault.java %regex[.*Test.*|.*Not.*]
+Since 3.0.0-M6, method filtering support is provided in the inclusions file as well, example: pkg.SomeTest#testMethod
+
+
+ jdkToolchain
+ java.util.Map
+ 3.0.0-M5 and Maven 3.3.x
+ false
+ true
+
+Allow for configuration of the test jvm via maven toolchains. This permits a configuration where the project is built with one jvm and tested with another. This is similar to jvm, but avoids hardcoding paths. The two parameters are mutually exclusive (jvm wins)
+
+Examples:
+(see Guide to Toolchains <https://maven.apache.org/guides/mini/guide-using-toolchains.html> for more info) <configuration> ... <jdkToolchain> <version>1.11</version> </jdkToolchain> </configuration> <configuration> ... <jdkToolchain> <version>1.8</version> <vendor>zulu</vendor> </jdkToolchain> </configuration>
+
+
+ junitArtifactName
+ java.lang.String
+ 2.3.1
+ false
+ true
+ Allows you to specify the name of the JUnit artifact. If not set, junit:junit will be used.
+
+
+ jvm
+ java.lang.String
+ 2.1
+ false
+ true
+ Option to specify the jvm (or path to the java executable) to use with the forking options. For the default, the jvm will be a new instance of the same VM as the one used to run Maven. JVM settings are not inherited from MAVEN_OPTS.
+
+
+ objectFactory
+ java.lang.String
+ 2.5
+ false
+ true
+ (TestNG only) Define the factory class used to create all test instances.
+
+
+ parallel
+ java.lang.String
+ 2.2
+ false
+ true
+ (TestNG provider) When you use the parameter parallel, TestNG will try to run all your test methods in separate threads, except for methods that depend on each other, which will be run in the same thread in order to respect their order of execution. Supports two values: classes or methods.
+(JUnit 4.7 provider) Supports values classes, methods, both to run in separate threads been controlled by threadCount.
+
+Since version 2.16 (JUnit 4.7 provider), the value both is DEPRECATED. Use classesAndMethods instead.
+
+Since version 2.16 (JUnit 4.7 provider), additional vales are available:
+suites, suitesAndClasses, suitesAndMethods, classesAndMethods, all.
+By default, Surefire does not execute tests in parallel. You can set the parameter parallel to none to explicitly disable parallel execution (e.g. when disabling parallel execution in special Maven profiles when executing coverage analysis).
+
+
+ parallelMavenExecution
+ java.lang.Boolean
+ false
+ false
+ Parallel Maven Execution.
+
+
+ parallelOptimized
+ boolean
+ 2.17
+ false
+ true
+ (JUnit 4.7 / provider only) The thread counts do not exceed the number of parallel suite, class runners and average number of methods per class if set to true.
+True by default.
+
+
+ parallelTestsTimeoutForcedInSeconds
+ double
+ 2.16
+ false
+ true
+ Stop executing queued parallel JUnit tests and interrupt currently running tests after a certain number of seconds.
+Example values: "3.5", "4"
+
+If set to 0, wait forever, never timing out. Makes sense with specified parallel different from "none".
+
+
+ parallelTestsTimeoutInSeconds
+ double
+ 2.16
+ false
+ true
+ Stop executing queued parallel JUnit tests after a certain number of seconds.
+Example values: "3.5", "4"
+
+If set to 0, wait forever, never timing out. Makes sense with specified parallel different from "none".
+
+
+ perCoreThreadCount
+ boolean
+ 2.5
+ false
+ true
+ (JUnit 4.7 provider) Indicates that threadCount, threadCountSuites, threadCountClasses, threadCountMethods are per cpu core.
+
+
+ pluginArtifactMap
+ java.util.Map
+ true
+ false
+ Map of plugin artifacts.
+
+
+ pluginDescriptor
+ org.apache.maven.plugin.descriptor.PluginDescriptor
+ 2.12
+ true
+ false
+ Information about this plugin, mainly used to lookup this plugin's configuration from the currently executing project.
+
+
+ printSummary
+ boolean
+ false
+ true
+ Option to print summary of test suites or just print the test cases that have errors.
+
+
+ project
+ org.apache.maven.project.MavenProject
+ true
+ false
+ The Maven Project Object.
+
+
+ projectArtifactMap
+ java.util.Map
+ true
+ false
+ Map of project artifacts.
+
+
+ projectBuildDirectory
+ java.io.File
+ 2.20
+ true
+ false
+ Read-only parameter with value of Maven property project.build.directory.
+
+
+ properties
+ java.util.Properties
+ 2.4
+ false
+ true
+ List of properties for configuring all TestNG related configurations. This is the new preferred method of configuring TestNG.
+
+
+ redirectTestOutputToFile
+ boolean
+ 2.3
+ false
+ true
+ Set this to "true" to redirect the unit test standard output to a file (found in reportsDirectory/testName-output.txt).
+
+
+ reportFormat
+ java.lang.String
+ false
+ true
+ Selects the formatting for the test report to be generated. Can be set as "brief" or "plain". Only applies to the output format of the output files (target/surefire-reports/testName.txt)
+
+
+ reportNameSuffix
+ java.lang.String
+ false
+ true
+ Add custom text into report filename: TEST-testClassName-reportNameSuffix.xml, testClassName-reportNameSuffix.txt and testClassName-reportNameSuffix-output.txt. File TEST-testClassName-reportNameSuffix.xml has changed attributes 'testsuite'--'name' and 'testcase'--'classname' - reportNameSuffix is added to the attribute value.
+
+
+ reportsDirectory
+ java.io.File
+ false
+ true
+ Base directory where all reports are written to.
+
+
+ rerunFailingTestsCount
+ int
+ false
+ true
+ (JUnit 4+ providers and JUnit 5+ providers since 3.0.0-M4) The number of times each failing test will be rerun. If set larger than 0, rerun failing tests immediately after they fail. If a failing test passes in any of those reruns, it will be marked as pass and reported as a "flake". However, all the failing attempts will be recorded.
+
+
+ reuseForks
+ boolean
+ 2.13
+ false
+ true
+ Indicates if forked VMs can be reused. If set to "false", a new VM is forked for each test class to be executed. If set to "true", up to forkCount VMs will be forked and then reused to execute all tests.
+
+
+ runOrder
+ java.lang.String
+ 2.7
+ false
+ true
+ Defines the order the tests will be run in. Supported values are alphabetical, reversealphabetical, random, hourly (alphabetical on even hours, reverse alphabetical on odd hours), failedfirst, balanced and filesystem.
+
+Odd/Even for hourly is determined at the time the of scanning the classpath, meaning it could change during a multi-module build.
+
+Failed first will run tests that failed on previous run first, as well as new tests for this run.
+
+Balanced is only relevant with parallel=classes, and will try to optimize the run-order of the tests reducing the overall execution time. Initially a statistics file is created and every next test run will reorder classes.
+
+Note that the statistics are stored in a file named .surefire-XXXXXXXXX beside pom.xml and should not be checked into version control. The "XXXXX" is the SHA1 checksum of the entire surefire configuration, so different configurations will have different statistics files, meaning if you change any configuration settings you will re-run once before new statistics data can be established.
+
+
+ runOrderRandomSeed
+ java.lang.Long
+ 3.0.0-M6
+ false
+ true
+ Sets the random seed that will be used to order the tests if surefire.runOrder is set to random.
+
+If no seeds are set and surefire.runOrder is set to random, then the seed used will be outputted (search for "To reproduce ordering use flag -Dsurefire.runOrder.random.seed").
+
+To deterministically reproduce any random test order that was run before, simply set the seed to be the same value.
+
+
+ session
+ org.apache.maven.execution.MavenSession
+ true
+ false
+ The current build session instance.
+
+
+ shutdown
+ java.lang.String
+ 2.19
+ false
+ true
+ After the plugin process is shutdown by sending SIGTERM signal (CTRL+C), SHUTDOWN command is received by every forked JVM.
+The value is set to (shutdown=exit) by default (changed in version 3.0.0-M4).
+The parameter can be configured with other two values testset and kill.
+With(shutdown=testset) the test set may still continue to run in forked JVM.
+Using exit forked JVM executes System.exit(1) after the plugin process has received SIGTERM signal.
+Using kill the JVM executes Runtime.halt(1) and kills itself.
+
+
+ skip
+ boolean
+ false
+ true
+ Set this to "true" to bypass unit tests entirely. Its use is NOT RECOMMENDED, especially if you enable it using the "maven.test.skip" property, because maven.test.skip disables both running the tests and compiling the tests. Consider using the skipTests parameter instead.
+
+
+ skipAfterFailureCount
+ int
+ 2.19
+ false
+ true
+ Set to error/failure count in order to skip remaining tests. Due to race conditions in parallel/forked execution this may not be fully guaranteed.
+Enable with system property -Dsurefire.skipAfterFailureCount=1 or any number greater than zero. Defaults to "0".
+See the prerequisites and limitations in documentation:
+http://maven.apache.org/plugins/maven-surefire-plugin/examples/skip-after-failure.html <http://maven.apache.org/plugins/maven-surefire-plugin/examples/skip-after-failure.html>
+
+
+ skipExec
+ boolean
+ 2.3
+ Use skipTests instead.
+ false
+ true
+ This old parameter is just like skipTests, but bound to the old property "maven.test.skip.exec".
+
+
+ skipTests
+ boolean
+ 2.4
+ false
+ true
+ Set this to "true" to skip running tests, but still compile them. Its use is NOT RECOMMENDED, but quite convenient on occasion.
+Failsafe plugin deprecated the parameter skipTests and the parameter will be removed in Failsafe 3.0.0 as it is a source of conflicts between Failsafe and Surefire plugin.
+
+
+ statelessTestsetInfoReporter
+ org.apache.maven.plugin.surefire.extensions.SurefireStatelessTestsetInfoReporter
+ false
+ true
+
+
+
+ statelessTestsetReporter
+ org.apache.maven.plugin.surefire.extensions.SurefireStatelessReporter
+ false
+ true
+ Note: use the legacy system property disableXmlReport set to true to disable the report.
+
+
+ suiteXmlFiles
+ java.io.File[]
+ 2.2
+ false
+ true
+ (TestNG) List of <suiteXmlFile> elements specifying TestNG suite xml file locations. Note that suiteXmlFiles is incompatible with several other parameters of this plugin, like includes and excludes.
+This parameter is ignored if the test parameter is specified (allowing you to run a single test instead of an entire suite).
+
+
+ systemProperties
+ java.util.Properties
+ Use systemPropertyVariables instead.
+ false
+ true
+ List of System properties to pass to a provider.
+
+
+ systemPropertiesFile
+ java.io.File
+ false
+ true
+
+
+
+ systemPropertyVariables
+ java.util.Map
+ 2.5
+ false
+ true
+ List of System properties to pass to a provider.
+
+
+ tempDir
+ java.lang.String
+ 2.20
+ false
+ true
+ Relative path to temporary-surefire-boot directory containing internal Surefire temporary files.
+The temporary-surefire-boot directory is project.build.directory on most platforms or system default temporary-directory specified by the system property java.io.tmpdir on Windows (see SUREFIRE-1400 <https://issues.apache.org/jira/browse/SUREFIRE-1400>).
+It is deleted after the test set has completed.
+
+
+ test
+ java.lang.String
+ false
+ true
+ Specify this parameter to run individual tests by file name, overriding the parameter includes and excludes. Each pattern you specify here will be used to create an include pattern formatted like **/${test}.java, so you can just type -Dtest=MyTest to run a single test called "foo/MyTest.java". The test patterns prefixed with a ! will be excluded.
+This parameter overrides the parameter includes, excludes, and the TestNG parameter suiteXmlFiles.
+Since 2.7.3, you can execute a limited number of methods in the test by adding #myMethod or #my*ethod. For example, -Dtest=MyTest#myMethod. This is supported for junit 4.x and TestNg.
+
+Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG): "-Dtest=???Test, !Unstable*, pkg/**/Ci*leTest.java, *Test#test*One+testTwo?????, #fast*+slowTest" or e.g. "-Dtest=Basic*, !%regex[.*.Unstable.*], !%regex[.*.MyTest.class#one.*|two.*], %regex[#fast.*|slow.*]"
+The Parameterized JUnit runner describes test methods using an index in brackets, so the non-regex method pattern would become: #testMethod[*]. If using @Parameters(name="{index}: fib({0})={1}") and selecting the index e.g. 5 in pattern, the non-regex method pattern would become #testMethod[5:*].
+
+
+ testClassesDirectory
+ java.io.File
+ false
+ true
+ The directory containing generated test classes of the project being tested. This will be included at the beginning of the test classpath.
+
+
+ testFailureIgnore
+ boolean
+ false
+ true
+ Set this to "true" to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion.
+
+
+ testNGArtifactName
+ java.lang.String
+ 2.3.1
+ false
+ true
+ Allows you to specify the name of the TestNG artifact. If not set, org.testng:testng will be used.
+
+
+ testSourceDirectory
+ java.io.File
+ 2.2
+ false
+ true
+ The test source directory containing test class sources. Important only for TestNG HTML reports.
+
+
+ threadCount
+ int
+ 2.2
+ false
+ true
+ (TestNG/JUnit 4.7 provider) The attribute thread-count allows you to specify how many threads should be allocated for this execution. Only makes sense to use in conjunction with the parallel parameter.
+
+
+ threadCountClasses
+ int
+ 2.16
+ false
+ true
+ (JUnit 4.7 provider) This attribute allows you to specify the concurrency in test classes, i.e.:
+* number of concurrent classes if threadCount is 0 or unspecified
+* limited classes concurrency if useUnlimitedThreads is set to true
+* if threadCount and certain thread-count parameters are > 0 for parallel, the concurrency is computed from ratio. For instance parallel=all and the ratio between threadCountSuites:threadCountClasses:threadCountMethods is 2:3:5, there is 30% of threadCount in concurrent classes.
+* as in the previous case but without this leaf thread-count. Example: parallel=suitesAndClasses, threadCount=16, threadCountSuites=5, threadCountClasses is unspecified leaf, the number of concurrent classes is varying from >= 11 to 14 or 15. The threadCountSuites become given number of threads. Only makes sense to use in conjunction with the parallel parameter. The default value 0 behaves same as unspecified one.
+
+
+ threadCountMethods
+ int
+ 2.16
+ false
+ true
+ (JUnit 4.7 provider) This attribute allows you to specify the concurrency in test methods, i.e.:
+* number of concurrent methods if threadCount is 0 or unspecified
+* limited concurrency of methods if useUnlimitedThreads is set to true
+* if threadCount and certain thread-count parameters are > 0 for parallel, the concurrency is computed from ratio. For instance parallel=all and the ratio between threadCountSuites:threadCountClasses:threadCountMethods is 2:3:5, there is 50% of threadCount which appears in concurrent methods.
+* as in the previous case but without this leaf thread-count. Example: parallel=all, threadCount=16, threadCountSuites=2, threadCountClasses=3, but threadCountMethods is unspecified leaf, the number of concurrent methods is varying from >= 11 to 14 or 15. The threadCountSuites and threadCountClasses become given number of threads. Only makes sense to use in conjunction with the parallel parameter. The default value 0 behaves same as unspecified one.
+
+
+ threadCountSuites
+ int
+ 2.16
+ false
+ true
+ (JUnit 4.7 provider) This attribute allows you to specify the concurrency in test suites, i.e.:
+* number of concurrent suites if threadCount is 0 or unspecified
+* limited suites concurrency if useUnlimitedThreads is set to true
+* if threadCount and certain thread-count parameters are > 0 for parallel, the concurrency is computed from ratio. For instance parallel=all and the ratio between threadCountSuites:threadCountClasses:threadCountMethods is 2:3:5, there is 20% of threadCount which appeared in concurrent suites. Only makes sense to use in conjunction with the parallel parameter. The default value 0 behaves same as unspecified one.
+
+
+ trimStackTrace
+ boolean
+ 2.2
+ false
+ true
+ Whether to trim the stack trace in the reports to just the lines within the test, or show the full trace.
+
+
+ useFile
+ boolean
+ false
+ true
+ Option to generate a file test report or just output the test report to the console.
+
+
+ useManifestOnlyJar
+ boolean
+ 2.4.3
+ false
+ true
+ By default, Surefire forks your tests using a manifest-only JAR; set this parameter to "false" to force it to launch your tests with a plain old Java classpath. (See the http://maven.apache.org/plugins/maven-surefire-plugin/examples/class-loading.html <http://maven.apache.org/plugins/maven-surefire-plugin/examples/class-loading.html> for a more detailed explanation of manifest-only JARs and their benefits.)
+Beware, setting this to "false" may cause your tests to fail on Windows if your classpath is too long.
+
+
+ useModulePath
+ boolean
+ 3.0.0-M2
+ false
+ true
+ When true, uses the modulepath when executing with JDK 9+ and module-info.java is present. When false, always uses the classpath.
+Defaults to true.
+
+
+ useSystemClassLoader
+ boolean
+ 2.3
+ false
+ true
+ Option to pass dependencies to the system's classloader instead of using an isolated class loader when forking. Prevents problems with JDKs which implement the service provider lookup mechanism by using the system's ClassLoader.
+
+
+ useUnlimitedThreads
+ boolean
+ 2.5
+ false
+ true
+ (JUnit 4.7 provider) Indicates that the thread pool will be unlimited. The parallel parameter and the actual number of classes/methods will decide. Setting this to "true" effectively disables perCoreThreadCount and threadCount. Defaults to "false".
+
+
+ workingDirectory
+ java.io.File
+ 2.1.3
+ false
+ true
+ Command line working directory.
+
+
+
+ ${maven.test.additionalClasspathDependencies}
+ ${maven.test.additionalClasspath}
+ ${argLine}
+
+ ${childDelegation}
+
+ ${maven.test.dependency.excludes}
+ ${maven.surefire.debug}
+ ${dependenciesToScan}
+ ${disableXmlReport}
+ ${enableAssertions}
+ ${surefire.enableProcessChecker}
+ ${surefire.encoding}
+ ${surefire.excludeJUnit5Engines}
+ ${surefire.excludedEnvironmentVariables}
+ ${excludedGroups}
+ ${surefire.excludes}
+ ${surefire.excludesFile}
+ ${surefire.failIfNoSpecifiedTests}
+ ${failIfNoTests}
+ ${surefire.failOnFlakeCount}
+ ${forkCount}
+ ${surefire.forkNode}
+ ${surefire.exitTimeout}
+ ${surefire.timeout}
+ ${groups}
+ ${surefire.includeJUnit5Engines}
+ ${surefire.includes}
+ ${surefire.includesFile}
+ ${junitArtifactName}
+ ${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.runOrder.random.seed}
+
+ ${surefire.shutdown}
+ ${maven.test.skip}
+ ${surefire.skipAfterFailureCount}
+ ${maven.test.skip.exec}
+ ${skipTests}
+ ${surefire.suiteXmlFiles}
+ ${surefire.systemPropertiesFile}
+ ${tempDir}
+ ${test}
+
+ ${maven.test.failure.ignore}
+ ${testNGArtifactName}
+
+ ${threadCount}
+ ${threadCountClasses}
+ ${threadCountMethods}
+ ${threadCountSuites}
+ ${trimStackTrace}
+ ${surefire.useFile}
+ ${surefire.useManifestOnlyJar}
+ ${surefire.useModulePath}
+ ${surefire.useSystemClassLoader}
+ ${useUnlimitedThreads}
+ ${basedir}
+
+
+
+ org.codehaus.plexus.languages.java.jpms.LocationManager
+ locationManager
+
+
+ org.codehaus.plexus.logging.Logger
+ logger
+
+
+ org.apache.maven.surefire.providerapi.ProviderDetector
+ providerDetector
+
+
+ org.apache.maven.plugin.surefire.SurefireDependencyResolver
+ surefireDependencyResolver
+
+
+ org.apache.maven.toolchain.ToolchainManager
+ toolchainManager
+
+
+
+
+
+
+ org.apache.maven.surefire
+ maven-surefire-common
+ jar
+ 3.2.5
+
+
+ org.apache.maven.surefire
+ surefire-api
+ jar
+ 3.2.5
+
+
+ org.apache.maven.surefire
+ surefire-logger-api
+ jar
+ 3.2.5
+
+
+ org.apache.maven.surefire
+ surefire-extensions-api
+ jar
+ 3.2.5
+
+
+ org.apache.maven.surefire
+ surefire-booter
+ jar
+ 3.2.5
+
+
+ org.apache.maven.surefire
+ surefire-extensions-spi
+ jar
+ 3.2.5
+
+
+ org.eclipse.aether
+ aether-util
+ jar
+ 1.0.0.v20140518
+
+
+ org.apache.maven.shared
+ maven-common-artifact-filters
+ jar
+ 3.1.1
+
+
+ org.codehaus.plexus
+ plexus-java
+ jar
+ 1.2.0
+
+
+ org.ow2.asm
+ asm
+ jar
+ 9.2
+
+
+ com.thoughtworks.qdox
+ qdox
+ jar
+ 2.0.1
+
+
+ org.apache.maven.surefire
+ surefire-shared-utils
+ jar
+ 3.2.5
+
+
+ commons-io
+ commons-io
+ jar
+ 2.15.1
+
+
+ org.apache.commons
+ commons-compress
+ jar
+ 1.25.0
+
+
+ org.slf4j
+ slf4j-api
+ jar
+ 1.7.36
+
+
+ org.apache.maven.resolver
+ maven-resolver-api
+ jar
+ 1.9.18
+
+
+ org.apache.maven.shared
+ maven-shared-utils
+ jar
+ 3.3.4
+
+
+ org.apache.commons
+ commons-lang3
+ jar
+ 3.14.0
+
+
+
\ No newline at end of file
--- /dev/null
+++ b/maven-surefire-plugin/src/main/java/org/apache/maven/plugin/maven_surefire_plugin/HelpMojo.java
@@ -0,0 +1,448 @@
+package org.apache.maven.plugins.maven_surefire_plugin;
+
+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;
+
+ // /META-INF/maven///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 );
+ try ( InputStream is = getClass().getResourceAsStream( PLUGIN_HELP_PATH ) )
+ {
+ if ( is == null )
+ {
+ throw new MojoExecutionException( "Could not find plugin descriptor at " + 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 );
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ 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 static String getValue( Node node, String elementName )
+ throws MojoExecutionException
+ {
+ return getSingleChild( node, elementName ).getTextContent();
+ }
+
+ private static 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 static 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 static 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 );
+ }
+ if ( isNotEmpty( parameterDescription ) ) {
+ 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 static 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;
+ }
+}
--- /dev/null
+++ b/maven-surefire-report-plugin/src/main/filtered-resources/META-INF/maven/org.apache.maven.plugins/maven-surefire-report-plugin/plugin-help.xml
@@ -0,0 +1,376 @@
+
+
+
+
+
+ ${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 <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
+ Whether to build an aggregated report at the root, or build individual reports.
+
+
+ alwaysGenerateFailsafeReport
+ boolean
+ 2.11
+ false
+ true
+ If set to true the failsafe report will be generated even when there are no failsafe result files. Defaults to false to preserve legacy behaviour pre 2.10.
+
+
+ customBundle
+ java.lang.String
+ 3.1.0
+ false
+ true
+ Path for a custom bundle instead of using the default one.
+Using this field, you could change the texts in the generated reports.
+
+
+ linkXRef
+ boolean
+ false
+ true
+ Whether to link the XRef if found.
+
+
+ outputName
+ java.lang.String
+ true
+ true
+ The filename to use for the report.
+
+
+ reportsDirectories
+ java.io.File[]
+ false
+ true
+ Directories containing the XML Report files that will be parsed and rendered to HTML format.
+
+
+ reportsDirectory
+ java.io.File
+ No reason given
+ false
+ true
+ (Deprecated, use reportsDirectories) This directory contains the XML Report files that will be parsed and rendered to HTML format.
+
+
+ showSuccess
+ boolean
+ true
+ true
+ If set to false, only failures are shown.
+
+
+ skipFailsafeReport
+ boolean
+ 2.11
+ false
+ true
+ If set to true the failsafe report generation will be skipped.
+
+
+ xrefLocation
+ java.io.File
+ false
+ true
+ Location of the Xrefs to link.
+
+
+
+ ${aggregate}
+ ${alwaysGenerateFailsafeReport}
+
+ ${linkXRef}
+ ${outputName}
+ ${showSuccess}
+ ${skipFailsafeReport}
+
+
+
+
+ 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.maven_surefire_report_plugin.HelpMojo
+ java
+ per-lookup
+ once-per-session
+ true
+
+
+ detail
+ boolean
+ false
+ true
+ If true, display all settable properties for each goal.
+
+
+ goal
+ java.lang.String
+ false
+ true
+ The name of the goal for which to show help. If unspecified, all goals will be displayed.
+
+
+ indentSize
+ int
+ false
+ true
+ The number of spaces per indentation level, should be positive.
+
+
+ lineLength
+ int
+ false
+ true
+ The maximum length of a display line, should be positive.
+
+
+
+ ${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
+ Whether to build an aggregated report at the root, or build individual reports.
+
+
+ alwaysGenerateSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ If set to true the surefire report will be generated even when there are no surefire result files. Defaults to true to preserve legacy behaviour pre 2.10.
+
+
+ customBundle
+ java.lang.String
+ 3.1.0
+ false
+ true
+ Path for a custom bundle instead of using the default one.
+Using this field, you could change the texts in the generated reports.
+
+
+ linkXRef
+ boolean
+ false
+ true
+ Whether to link the XRef if found.
+
+
+ outputName
+ java.lang.String
+ true
+ true
+ The filename to use for the report.
+
+
+ reportsDirectories
+ java.io.File[]
+ false
+ true
+ Directories containing the XML Report files that will be parsed and rendered to HTML format.
+
+
+ reportsDirectory
+ java.io.File
+ No reason given
+ false
+ true
+ (Deprecated, use reportsDirectories) This directory contains the XML Report files that will be parsed and rendered to HTML format.
+
+
+ showSuccess
+ boolean
+ true
+ true
+ If set to false, only failures are shown.
+
+
+ skipSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ If set to true the surefire report generation will be skipped.
+
+
+ xrefLocation
+ java.io.File
+ false
+ true
+ Location of the Xrefs to link.
+
+
+
+ ${aggregate}
+ ${alwaysGenerateSurefireReport}
+
+ ${linkXRef}
+ ${outputName}
+ ${showSuccess}
+ ${skipSurefireReport}
+
+
+
+
+ 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 <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
+ Whether to build an aggregated report at the root, or build individual reports.
+
+
+ alwaysGenerateSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ If set to true the surefire report will be generated even when there are no surefire result files. Defaults to true to preserve legacy behaviour pre 2.10.
+
+
+ customBundle
+ java.lang.String
+ 3.1.0
+ false
+ true
+ Path for a custom bundle instead of using the default one.
+Using this field, you could change the texts in the generated reports.
+
+
+ linkXRef
+ boolean
+ false
+ true
+ Whether to link the XRef if found.
+
+
+ outputName
+ java.lang.String
+ true
+ true
+ The filename to use for the report.
+
+
+ reportsDirectories
+ java.io.File[]
+ false
+ true
+ Directories containing the XML Report files that will be parsed and rendered to HTML format.
+
+
+ reportsDirectory
+ java.io.File
+ No reason given
+ false
+ true
+ (Deprecated, use reportsDirectories) This directory contains the XML Report files that will be parsed and rendered to HTML format.
+
+
+ showSuccess
+ boolean
+ true
+ true
+ If set to false, only failures are shown.
+
+
+ skipSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ If set to true the surefire report generation will be skipped.
+
+
+ xrefLocation
+ java.io.File
+ false
+ true
+ Location of the Xrefs to link.
+
+
+
+ ${aggregate}
+ ${alwaysGenerateSurefireReport}
+
+ ${linkXRef}
+ ${outputName}
+ ${showSuccess}
+ ${skipSurefireReport}
+
+
+
+
+
\ No newline at end of file
--- /dev/null
+++ b/maven-surefire-report-plugin/src/main/filtered-resources/META-INF/maven/plugin.xml
@@ -0,0 +1,838 @@
+
+
+
+
+
+ ${project.name}
+ ${project.description}
+ ${project.groupId}
+ ${project.artifactId}
+ ${project.version}
+ surefire-report
+ false
+ true
+ 1.8
+ 3.2.5
+
+
+ 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 <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
+ Whether to build an aggregated report at the root, or build individual reports.
+
+
+ alwaysGenerateFailsafeReport
+ boolean
+ 2.11
+ false
+ true
+ If set to true the failsafe report will be generated even when there are no failsafe result files. Defaults to false to preserve legacy behaviour pre 2.10.
+
+
+ customBundle
+ java.lang.String
+ 3.1.0
+ false
+ true
+ Path for a custom bundle instead of using the default one.
+Using this field, you could change the texts in the generated reports.
+
+
+ inputEncoding
+ java.lang.String
+ false
+ false
+
+
+
+ linkXRef
+ boolean
+ false
+ true
+ Whether to link the XRef if found.
+
+
+ localRepository
+ org.apache.maven.artifact.repository.ArtifactRepository
+ true
+ false
+
+
+
+ outputDirectory
+ java.io.File
+ true
+ false
+
+
+
+ outputEncoding
+ java.lang.String
+ false
+ false
+
+
+
+ outputName
+ java.lang.String
+ true
+ true
+ The filename to use for the report.
+
+
+ project
+ org.apache.maven.project.MavenProject
+ true
+ false
+
+
+
+ reactorProjects
+ java.util.List
+ false
+ false
+ The projects in the reactor for aggregation report.
+
+
+ remoteRepositories
+ java.util.List
+ true
+ false
+
+
+
+ reportsDirectories
+ java.io.File[]
+ false
+ true
+ Directories containing the XML Report files that will be parsed and rendered to HTML format.
+
+
+ reportsDirectory
+ java.io.File
+ No reason given
+ false
+ true
+ (Deprecated, use reportsDirectories) This directory contains the XML Report files that will be parsed and rendered to HTML format.
+
+
+ settings
+ org.apache.maven.settings.Settings
+ true
+ false
+ The current user system settings for use in Maven.
+
+
+ showSuccess
+ boolean
+ true
+ true
+ If set to false, only failures are shown.
+
+
+ skipFailsafeReport
+ boolean
+ 2.11
+ false
+ true
+ If set to true the failsafe report generation will be skipped.
+
+
+ xrefLocation
+ java.io.File
+ false
+ true
+ Location of the Xrefs to link.
+
+
+
+ ${aggregate}
+ ${alwaysGenerateFailsafeReport}
+
+ ${encoding}
+ ${linkXRef}
+
+
+ ${outputEncoding}
+ ${outputName}
+
+
+
+
+ ${showSuccess}
+ ${skipFailsafeReport}
+
+
+
+
+ org.codehaus.plexus.i18n.I18N
+ i18n
+
+
+ org.apache.maven.doxia.siterenderer.Renderer
+ siteRenderer
+
+
+ org.apache.maven.doxia.tools.SiteTool
+ siteTool
+
+
+
+
+ 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.maven_surefire_report_plugin.HelpMojo
+ java
+ per-lookup
+ once-per-session
+ true
+
+
+ detail
+ boolean
+ false
+ true
+ If true, display all settable properties for each goal.
+
+
+ goal
+ java.lang.String
+ false
+ true
+ The name of the goal for which to show help. If unspecified, all goals will be displayed.
+
+
+ indentSize
+ int
+ false
+ true
+ The number of spaces per indentation level, should be positive.
+
+
+ lineLength
+ int
+ false
+ true
+ The maximum length of a display line, should be positive.
+
+
+
+ ${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
+ Whether to build an aggregated report at the root, or build individual reports.
+
+
+ alwaysGenerateSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ If set to true the surefire report will be generated even when there are no surefire result files. Defaults to true to preserve legacy behaviour pre 2.10.
+
+
+ customBundle
+ java.lang.String
+ 3.1.0
+ false
+ true
+ Path for a custom bundle instead of using the default one.
+Using this field, you could change the texts in the generated reports.
+
+
+ inputEncoding
+ java.lang.String
+ false
+ false
+
+
+
+ linkXRef
+ boolean
+ false
+ true
+ Whether to link the XRef if found.
+
+
+ localRepository
+ org.apache.maven.artifact.repository.ArtifactRepository
+ true
+ false
+
+
+
+ outputDirectory
+ java.io.File
+ true
+ false
+
+
+
+ outputEncoding
+ java.lang.String
+ false
+ false
+
+
+
+ outputName
+ java.lang.String
+ true
+ true
+ The filename to use for the report.
+
+
+ project
+ org.apache.maven.project.MavenProject
+ true
+ false
+
+
+
+ reactorProjects
+ java.util.List
+ false
+ false
+ The projects in the reactor for aggregation report.
+
+
+ remoteRepositories
+ java.util.List
+ true
+ false
+
+
+
+ reportsDirectories
+ java.io.File[]
+ false
+ true
+ Directories containing the XML Report files that will be parsed and rendered to HTML format.
+
+
+ reportsDirectory
+ java.io.File
+ No reason given
+ false
+ true
+ (Deprecated, use reportsDirectories) This directory contains the XML Report files that will be parsed and rendered to HTML format.
+
+
+ settings
+ org.apache.maven.settings.Settings
+ true
+ false
+ The current user system settings for use in Maven.
+
+
+ showSuccess
+ boolean
+ true
+ true
+ If set to false, only failures are shown.
+
+
+ skipSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ If set to true the surefire report generation will be skipped.
+
+
+ xrefLocation
+ java.io.File
+ false
+ true
+ Location of the Xrefs to link.
+
+
+
+ ${aggregate}
+ ${alwaysGenerateSurefireReport}
+
+ ${encoding}
+ ${linkXRef}
+
+
+ ${outputEncoding}
+ ${outputName}
+
+
+
+
+ ${showSuccess}
+ ${skipSurefireReport}
+
+
+
+
+ org.codehaus.plexus.i18n.I18N
+ i18n
+
+
+ org.apache.maven.doxia.siterenderer.Renderer
+ siteRenderer
+
+
+ org.apache.maven.doxia.tools.SiteTool
+ siteTool
+
+
+
+
+ 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 <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
+ Whether to build an aggregated report at the root, or build individual reports.
+
+
+ alwaysGenerateSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ If set to true the surefire report will be generated even when there are no surefire result files. Defaults to true to preserve legacy behaviour pre 2.10.
+
+
+ customBundle
+ java.lang.String
+ 3.1.0
+ false
+ true
+ Path for a custom bundle instead of using the default one.
+Using this field, you could change the texts in the generated reports.
+
+
+ inputEncoding
+ java.lang.String
+ false
+ false
+
+
+
+ linkXRef
+ boolean
+ false
+ true
+ Whether to link the XRef if found.
+
+
+ localRepository
+ org.apache.maven.artifact.repository.ArtifactRepository
+ true
+ false
+
+
+
+ outputDirectory
+ java.io.File
+ true
+ false
+
+
+
+ outputEncoding
+ java.lang.String
+ false
+ false
+
+
+
+ outputName
+ java.lang.String
+ true
+ true
+ The filename to use for the report.
+
+
+ project
+ org.apache.maven.project.MavenProject
+ true
+ false
+
+
+
+ reactorProjects
+ java.util.List
+ false
+ false
+ The projects in the reactor for aggregation report.
+
+
+ remoteRepositories
+ java.util.List
+ true
+ false
+
+
+
+ reportsDirectories
+ java.io.File[]
+ false
+ true
+ Directories containing the XML Report files that will be parsed and rendered to HTML format.
+
+
+ reportsDirectory
+ java.io.File
+ No reason given
+ false
+ true
+ (Deprecated, use reportsDirectories) This directory contains the XML Report files that will be parsed and rendered to HTML format.
+
+
+ settings
+ org.apache.maven.settings.Settings
+ true
+ false
+ The current user system settings for use in Maven.
+
+
+ showSuccess
+ boolean
+ true
+ true
+ If set to false, only failures are shown.
+
+
+ skipSurefireReport
+ boolean
+ 2.11
+ false
+ true
+ If set to true the surefire report generation will be skipped.
+
+
+ xrefLocation
+ java.io.File
+ false
+ true
+ Location of the Xrefs to link.
+
+
+
+ ${aggregate}
+ ${alwaysGenerateSurefireReport}
+
+ ${encoding}
+ ${linkXRef}
+
+
+ ${outputEncoding}
+ ${outputName}
+
+
+
+
+ ${showSuccess}
+ ${skipSurefireReport}
+
+
+
+
+ org.codehaus.plexus.i18n.I18N
+ i18n
+
+
+ org.apache.maven.doxia.siterenderer.Renderer
+ siteRenderer
+
+
+ org.apache.maven.doxia.tools.SiteTool
+ siteTool
+
+
+
+
+
+
+ org.apache.maven.surefire
+ surefire-report-parser
+ jar
+ 3.2.5
+
+
+ org.apache.maven.surefire
+ surefire-logger-api
+ jar
+ 3.2.5
+
+
+ org.apache.maven.shared
+ maven-shared-utils
+ jar
+ 3.3.4
+
+
+ commons-io
+ commons-io
+ jar
+ 2.15.1
+
+
+ org.codehaus.plexus
+ plexus-classworlds
+ jar
+ 2.7.0
+
+
+ org.codehaus.plexus
+ plexus-component-annotations
+ jar
+ 2.1.0
+
+
+ org.apache.commons
+ commons-lang3
+ jar
+ 3.14.0
+
+
+ org.codehaus.plexus
+ plexus-interpolation
+ jar
+ 1.26
+
+
+ org.codehaus.plexus
+ plexus-utils
+ jar
+ 4.0.0
+
+
+ org.apache.maven.doxia
+ doxia-sink-api
+ jar
+ 1.12.0
+
+
+ org.apache.maven.doxia
+ doxia-logging-api
+ jar
+ 1.12.0
+
+
+ org.apache.maven.doxia
+ doxia-core
+ jar
+ 1.12.0
+
+
+ org.codehaus.plexus
+ plexus-container-default
+ jar
+ 2.1.0
+
+
+ org.ow2.asm
+ asm
+ jar
+ 5.0.3
+
+
+ org.ow2.asm
+ asm-commons
+ jar
+ 5.0.3
+
+
+ org.ow2.asm
+ asm-tree
+ jar
+ 9.6
+
+
+ org.apache.xbean
+ xbean-reflect
+ jar
+ 3.7
+
+
+ junit
+ junit
+ jar
+ 4.13.2
+
+
+ org.hamcrest
+ hamcrest-core
+ jar
+ 1.3
+
+
+ org.apache.commons
+ commons-text
+ jar
+ 1.3
+
+
+ org.apache.httpcomponents
+ httpclient
+ jar
+ 4.5.13
+
+
+ commons-logging
+ commons-logging
+ jar
+ 1.2
+
+
+ commons-codec
+ commons-codec
+ jar
+ 1.11
+
+
+ org.apache.httpcomponents
+ httpcore
+ jar
+ 4.4.14
+
+
+ org.apache.maven.reporting
+ maven-reporting-api
+ jar
+ 3.1.1
+
+
+ org.apache.maven.reporting
+ maven-reporting-impl
+ jar
+ 3.2.0
+
+
+ org.apache.maven.doxia
+ doxia-site-renderer
+ jar
+ 1.11.1
+
+
+ commons-collections
+ commons-collections
+ jar
+ 3.2.2
+
+
+ org.apache.maven.doxia
+ doxia-skin-model
+ jar
+ 1.11.1
+
+
+ org.apache.maven.doxia
+ doxia-module-xhtml5
+ jar
+ 1.11.1
+
+
+ org.codehaus.plexus
+ plexus-i18n
+ jar
+ 1.0-beta-10
+
+
+ org.codehaus.plexus
+ plexus-velocity
+ jar
+ 1.2
+
+
+ org.apache.maven.doxia
+ doxia-module-xhtml
+ jar
+ 1.11.1
+
+
+ org.apache.velocity
+ velocity
+ jar
+ 1.7
+
+
+ org.apache.maven.doxia
+ doxia-decoration-model
+ jar
+ 1.11.1
+
+
+ org.apache.maven.doxia
+ doxia-integration-tools
+ jar
+ 1.11.1
+
+
+ org.codehaus.plexus
+ plexus-xml
+ jar
+ 4.0.0
+
+
+
\ No newline at end of file
--- /dev/null
+++ b/maven-surefire-report-plugin/src/main/java/org/apache/maven/plugin/maven_surefire_report_plugin/HelpMojo.java
@@ -0,0 +1,448 @@
+package org.apache.maven.plugins.maven_surefire_report_plugin;
+
+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;
+
+ // /META-INF/maven///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 );
+ try ( InputStream is = getClass().getResourceAsStream( PLUGIN_HELP_PATH ) )
+ {
+ if ( is == null )
+ {
+ throw new MojoExecutionException( "Could not find plugin descriptor at " + 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 );
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ 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 static String getValue( Node node, String elementName )
+ throws MojoExecutionException
+ {
+ return getSingleChild( node, elementName ).getTextContent();
+ }
+
+ private static 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 static 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 static 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 );
+ }
+ if ( isNotEmpty( parameterDescription ) ) {
+ 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 static 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;
+ }
+}
--
2.44.0