Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
maven-surefire
maven-surefire-bootstrap-resources.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File maven-surefire-bootstrap-resources.patch of Package maven-surefire
--- /dev/null +++ b/maven-failsafe-plugin/src/main/filtered-resources/META-INF/maven/org.apache.maven.plugins/maven-failsafe-plugin/plugin-help.xml @@ -0,0 +1,1038 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- Generated by maven-plugin-tools 3.9 (for help'mojo with additional elements)--> + +<plugin> + <name>${project.name}</name> + <description>${project.description}</description> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + <goalPrefix>failsafe</goalPrefix> + <mojos> + <mojo> + <goal>help</goal> + <description>Display help information on maven-failsafe-plugin. +Call mvn failsafe:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.</description> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>false</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <implementation>org.apache.maven.plugins.maven_failsafe_plugin.HelpMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <threadSafe>true</threadSafe> + <parameters> + <parameter> + <name>detail</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>If true, display all settable properties for each goal.</description> + </parameter> + <parameter> + <name>goal</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>The name of the goal for which to show help. If unspecified, all goals will be displayed.</description> + </parameter> + <parameter> + <name>indentSize</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>The number of spaces per indentation level, should be positive.</description> + </parameter> + <parameter> + <name>lineLength</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>The maximum length of a display line, should be positive.</description> + </parameter> + </parameters> + <configuration> + <detail implementation="boolean" default-value="false">${detail}</detail> + <goal implementation="java.lang.String">${goal}</goal> + <indentSize implementation="int" default-value="2">${indentSize}</indentSize> + <lineLength implementation="int" default-value="80">${lineLength}</lineLength> + </configuration> + </mojo> + <mojo> + <goal>integration-test</goal> + <description>Run integration tests using Surefire.</description> + <requiresDependencyResolution>test</requiresDependencyResolution> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>true</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <phase>integration-test</phase> + <implementation>org.apache.maven.plugin.failsafe.IntegrationTestMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <threadSafe>true</threadSafe> + <parameters> + <parameter> + <name>additionalClasspathDependencies</name> + <type>java.util.List<org.apache.maven.model.Dependency></type> + <since>3.2</since> + <required>false</required> + <editable>true</editable> + <description>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. </description> + </parameter> + <parameter> + <name>additionalClasspathElements</name> + <type>java.lang.String[]</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>argLine</name> + <type>java.lang.String</type> + <since>2.1</since> + <required>false</required> + <editable>true</editable> + <description>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></description> + </parameter> + <parameter> + <name>childDelegation</name> + <type>boolean</type> + <since>2.1</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>classesDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>The path representing project JAR file, if exists; Otherwise the directory containing generated classes of the project being tested. This will be included after the test classes in the test classpath. Defaults to built artifact JAR file or ${project.build.outputDirectory}.</description> + </parameter> + <parameter> + <name>classpathDependencyExcludes</name> + <type>java.lang.String[]</type> + <since>2.6</since> + <required>false</required> + <editable>true</editable> + <description>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!</description> + </parameter> + <parameter> + <name>classpathDependencyScopeExclude</name> + <type>java.lang.String</type> + <since>2.6</since> + <required>false</required> + <editable>true</editable> + <description>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 </description> + </parameter> + <parameter> + <name>consoleOutputReporter</name> + <type>org.apache.maven.plugin.surefire.extensions.SurefireConsoleOutputReporter</type> + <required>false</required> + <editable>true</editable> + <description></description> + </parameter> + <parameter> + <name>debugForkedProcess</name> + <type>java.lang.String</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>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 debugging ability options (without overwriting the other options specified through the argLine parameter).</description> + </parameter> + <parameter> + <name>dependenciesToScan</name> + <type>java.lang.String[]</type> + <since>2.15</since> + <required>false</required> + <editable>true</editable> + <description>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. +</description> + </parameter> + <parameter> + <name>disableXmlReport</name> + <type>boolean</type> + <since>2.2</since> + <deprecated>No reason given</deprecated> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>enableAssertions</name> + <type>boolean</type> + <since>2.3.1</since> + <required>false</required> + <editable>true</editable> + <description>By default, Surefire enables JVM assertions for the execution of your test cases. To disable the assertions, set this flag to "false".</description> + </parameter> + <parameter> + <name>enableProcessChecker</name> + <type>java.lang.String</type> + <since>3.0.0-M4</since> + <required>false</required> + <editable>true</editable> + <description>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 -Dfailsafe.enableProcessChecker=all</description> + </parameter> + <parameter> + <name>encoding</name> + <type>java.lang.String</type> + <since>3.0.0-M1</since> + <required>false</required> + <editable>true</editable> + <description>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 still encoded with JVM's encoding used in standard out/err pipes.</description> + </parameter> + <parameter> + <name>environmentVariables</name> + <type>java.util.Map<java.lang.String, java.lang.String></type> + <since>2.1.3</since> + <required>false</required> + <editable>true</editable> + <description>Additional environment variables to set on the command line.</description> + </parameter> + <parameter> + <name>excludedEnvironmentVariables</name> + <type>java.lang.String[]</type> + <since>3.0.0-M4</since> + <required>false</required> + <editable>true</editable> + <description>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 -Dfailsafe.excludedEnvironmentVariables=ACME1,ACME2,ACME3</description> + </parameter> + <parameter> + <name>excludedGroups</name> + <type>java.lang.String</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>excludeJUnit5Engines</name> + <type>java.lang.String[]</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>Provide the ID/s of an JUnit engine to be excluded in the test run.</description> + </parameter> + <parameter> + <name>excludes</name> + <type>java.util.List<java.lang.String></type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>excludesFile</name> + <type>java.io.File</type> + <since>2.13</since> + <required>false</required> + <editable>true</editable> + <description>A file containing exclude patterns, each in a next line. Blank lines, or lines starting with # are ignored. If excludes are also specified, these patterns are appended. Example with path, simple and regex excludes: */it/* **/DontRunIT.* %regex[.*IT.*|.*Not.*] +Since 3.0.0-M6, method filtering support is provided in the exclusions file as well, example: pkg.SomeIT#testMethod </description> + </parameter> + <parameter> + <name>failIfNoSpecifiedTests</name> + <type>boolean</type> + <since>3.0.0-M8</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "false" to prevent a failure if none of the tests specified in -Dit.test=... are run. Defaults to "true". Replacing "it.failIfNoSpecifiedTests" to be consistent with surefire plugin.</description> + </parameter> + <parameter> + <name>failIfNoSpecifiedTestsDeprecated</name> + <type>boolean</type> + <since>2.12</since> + <deprecated>Since 3.0.0-M8, use "failsafe.failIfNoSpecifiedTests" instead.</deprecated> + <required>false</required> + <editable>true</editable> + <description>Set this to "false" to prevent a failure if none of the tests specified in -Dit.test=... are run. Defaults to "true".</description> + </parameter> + <parameter> + <name>failIfNoTests</name> + <type>boolean</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to cause a failure if there are no tests to run. Defaults to "false".</description> + </parameter> + <parameter> + <name>forkCount</name> + <type>java.lang.String</type> + <since>2.14</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>forkedProcessExitTimeoutInSeconds</name> + <type>int</type> + <since>2.20</since> + <required>false</required> + <editable>true</editable> + <description>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-failsafe-plugin/examples/shutdown.html <http://maven.apache.org/surefire/maven-failsafe-plugin/examples/shutdown.html></description> + </parameter> + <parameter> + <name>forkedProcessTimeoutInSeconds</name> + <type>int</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>Kill the forked test process after a certain number of seconds. If set to 0, wait forever for the process, never timing out.</description> + </parameter> + <parameter> + <name>forkNode</name> + <type>org.apache.maven.surefire.extensions.ForkNodeFactory</type> + <since>3.0.0-M5</since> + <required>false</required> + <editable>true</editable> + <description>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></description> + </parameter> + <parameter> + <name>groups</name> + <type>java.lang.String</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>includeJUnit5Engines</name> + <type>java.lang.String[]</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>Provide the ID/s of an JUnit engine to be included in the test run.</description> + </parameter> + <parameter> + <name>includes</name> + <type>java.util.List<java.lang.String></type> + <required>false</required> + <editable>true</editable> + <description>A list of <include> elements specifying the test filter (by pattern) of tests which should be included in testing. If it is not specified and the test parameter is unspecified as well, the default includes is <includes> <include>**/IT*.java</include> <include>**/*IT.java</include> <include>**/*ITCase.java</include> </includes> +Each include item may also contain a comma-separated sublist 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.</description> + </parameter> + <parameter> + <name>includesFile</name> + <type>java.io.File</type> + <since>2.13</since> + <required>false</required> + <editable>true</editable> + <description>A file containing include patterns, each in a next line. Blank lines, or lines starting with # are ignored. If includes are also specified, these patterns are appended. Example with path, simple and regex includes: */it/* **/NotIncludedByDefault.java %regex[.*IT.*|.*Not.*] +Since 3.0.0-M6, method filtering support is provided in the inclusions file as well, example: pkg.SomeIT#testMethod </description> + </parameter> + <parameter> + <name>jdkToolchain</name> + <type>java.util.Map<java.lang.String, java.lang.String></type> + <since>3.0.0-M5 and Maven 3.3.x</since> + <required>false</required> + <editable>true</editable> + <description> +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> </description> + </parameter> + <parameter> + <name>junitArtifactName</name> + <type>java.lang.String</type> + <since>2.3.1</since> + <required>false</required> + <editable>true</editable> + <description>Allows you to specify the name of the JUnit artifact. If not set, junit:junit will be used.</description> + </parameter> + <parameter> + <name>jvm</name> + <type>java.lang.String</type> + <since>2.1</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>objectFactory</name> + <type>java.lang.String</type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>(TestNG only) Define the factory class used to create all test instances.</description> + </parameter> + <parameter> + <name>parallel</name> + <type>java.lang.String</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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).</description> + </parameter> + <parameter> + <name>parallelOptimized</name> + <type>boolean</type> + <since>2.17</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>parallelTestsTimeoutForcedInSeconds</name> + <type>double</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>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".</description> + </parameter> + <parameter> + <name>parallelTestsTimeoutInSeconds</name> + <type>double</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>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".</description> + </parameter> + <parameter> + <name>perCoreThreadCount</name> + <type>boolean</type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>(JUnit 4.7 provider) Indicates that threadCount, threadCountSuites, threadCountClasses, threadCountMethods are per cpu core.</description> + </parameter> + <parameter> + <name>printSummary</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Option to print summary of test suites or just print the test cases that have errors.</description> + </parameter> + <parameter> + <name>properties</name> + <type>java.util.Properties</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>List of properties for configuring all TestNG related configurations. This is the new preferred method of configuring TestNG.</description> + </parameter> + <parameter> + <name>redirectTestOutputToFile</name> + <type>boolean</type> + <since>2.3</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to redirect the unit test standard output to a file (found in reportsDirectory/testName-output.txt).</description> + </parameter> + <parameter> + <name>reportFormat</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>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)</description> + </parameter> + <parameter> + <name>reportNameSuffix</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>reportsDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>Base directory where all reports are written to.</description> + </parameter> + <parameter> + <name>rerunFailingTestsCount</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>reuseForks</name> + <type>boolean</type> + <since>2.13</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>runOrder</name> + <type>java.lang.String</type> + <since>2.7</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>runOrderRandomSeed</name> + <type>java.lang.Long</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>Sets the random seed that will be used to order the tests if failsafe.runOrder is set to random. + +If no seeds are set and failsafe.runOrder is set to random, then the seed used will be outputted (search for "To reproduce ordering use flag -Dfailsafe.runOrder.random.seed"). + +To deterministically reproduce any random test order that was run before, simply set the seed to be the same value.</description> + </parameter> + <parameter> + <name>shutdown</name> + <type>java.lang.String</type> + <since>2.19</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>skip</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>skipAfterFailureCount</name> + <type>int</type> + <since>2.19</since> + <required>false</required> + <editable>true</editable> + <description>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 -Dfailsafe.skipAfterFailureCount=1 or any number greater than zero. Defaults to "0". +See the prerequisites and limitations in documentation: +http://maven.apache.org/plugins/maven-failsafe-plugin/examples/skip-after-failure.html <http://maven.apache.org/plugins/maven-failsafe-plugin/examples/skip-after-failure.html></description> + </parameter> + <parameter> + <name>skipExec</name> + <type>boolean</type> + <since>2.3</since> + <deprecated>Use skipTests instead.</deprecated> + <required>false</required> + <editable>true</editable> + <description>This old parameter is just like skipTests, but bound to the old property "maven.test.skip.exec".</description> + </parameter> + <parameter> + <name>skipITs</name> + <type>boolean</type> + <since>2.4.3-alpha-2</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to skip running integration tests, but still compile them. Its use is NOT RECOMMENDED, but quite convenient on occasion.</description> + </parameter> + <parameter> + <name>skipTests</name> + <type>boolean</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>statelessTestsetInfoReporter</name> + <type>org.apache.maven.plugin.surefire.extensions.SurefireStatelessTestsetInfoReporter</type> + <required>false</required> + <editable>true</editable> + <description></description> + </parameter> + <parameter> + <name>statelessTestsetReporter</name> + <type>org.apache.maven.plugin.surefire.extensions.SurefireStatelessReporter</type> + <required>false</required> + <editable>true</editable> + <description>Note: use the legacy system property disableXmlReport set to true to disable the report.</description> + </parameter> + <parameter> + <name>suiteXmlFiles</name> + <type>java.io.File[]</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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).</description> + </parameter> + <parameter> + <name>summaryFile</name> + <type>java.io.File</type> + <required>true</required> + <editable>true</editable> + <description>The summary file to write integration test results to.</description> + </parameter> + <parameter> + <name>systemProperties</name> + <type>java.util.Properties</type> + <deprecated>Use systemPropertyVariables instead.</deprecated> + <required>false</required> + <editable>true</editable> + <description>List of System properties to pass to a provider.</description> + </parameter> + <parameter> + <name>systemPropertiesFile</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description></description> + </parameter> + <parameter> + <name>systemPropertyVariables</name> + <type>java.util.Map<java.lang.String, java.lang.String></type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>List of System properties to pass to a provider.</description> + </parameter> + <parameter> + <name>tempDir</name> + <type>java.lang.String</type> + <since>2.20</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>test</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>Specify this parameter to run individual tests by file name, overriding parameter includes and excludes. Each pattern you specify here will be used to create an include pattern formatted like **/${it.test}.java, so you can just type -Dit.test=MyIT to run a single test file called "foo/MyIT.java". The test patterns prefixed with a ! will be excluded. +This parameter overrides the parameter includes and excludes, and the TestNG parameter suiteXmlFiles. +Since 2.7.3 You can execute a limited number of methods in the test with adding #myMethod or #my*ethod. E.g. type -Dit.test=MyIT#myMethod supported for junit 4.x and TestNg. +Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG): "-Dit.test=???IT, !Unstable*, pkg/**/Ci*leIT.java, *IT#test*One+testTwo?????, #fast*+slowTest" or e.g. +"-Dit.test=Basic*, !%regex[.*.Unstable.*], !%regex[.*.MyIT.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:*].</description> + </parameter> + <parameter> + <name>testClassesDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>The directory containing generated test classes of the project being tested. This will be included at the beginning of the test classpath.</description> + </parameter> + <parameter> + <name>testNGArtifactName</name> + <type>java.lang.String</type> + <since>2.3.1</since> + <required>false</required> + <editable>true</editable> + <description>Allows you to specify the name of the TestNG artifact. If not set, org.testng:testng will be used.</description> + </parameter> + <parameter> + <name>testSourceDirectory</name> + <type>java.io.File</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>The test source directory containing test class sources. Important only for TestNG HTML reports.</description> + </parameter> + <parameter> + <name>threadCount</name> + <type>int</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>threadCountClasses</name> + <type>int</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>threadCountMethods</name> + <type>int</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>threadCountSuites</name> + <type>int</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>trimStackTrace</name> + <type>boolean</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>Whether to trim the stack trace in the reports to just the lines within the test, or show the full trace.</description> + </parameter> + <parameter> + <name>useFile</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Option to generate a file test report or just output the test report to the console.</description> + </parameter> + <parameter> + <name>useManifestOnlyJar</name> + <type>boolean</type> + <since>2.4.3</since> + <required>false</required> + <editable>true</editable> + <description>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-failsafe-plugin/examples/class-loading.html <http://maven.apache.org/plugins/maven-failsafe-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.</description> + </parameter> + <parameter> + <name>useModulePath</name> + <type>boolean</type> + <since>3.0.0-M2</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>useSystemClassLoader</name> + <type>boolean</type> + <since>2.3</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>useUnlimitedThreads</name> + <type>boolean</type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>(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".</description> + </parameter> + <parameter> + <name>workingDirectory</name> + <type>java.io.File</type> + <since>2.1.3</since> + <required>false</required> + <editable>true</editable> + <description>Command line working directory.</description> + </parameter> + </parameters> + <configuration> + <additionalClasspathDependencies implementation="java.util.List">${maven.test.additionalClasspathDependencies}</additionalClasspathDependencies> + <additionalClasspathElements implementation="java.lang.String[]">${maven.test.additionalClasspath}</additionalClasspathElements> + <argLine implementation="java.lang.String">${argLine}</argLine> + <childDelegation implementation="boolean" default-value="false">${childDelegation}</childDelegation> + <classpathDependencyExcludes implementation="java.lang.String[]">${maven.test.dependency.excludes}</classpathDependencyExcludes> + <debugForkedProcess implementation="java.lang.String">${maven.failsafe.debug}</debugForkedProcess> + <dependenciesToScan implementation="java.lang.String[]">${dependenciesToScan}</dependenciesToScan> + <disableXmlReport implementation="boolean" default-value="false">${disableXmlReport}</disableXmlReport> + <enableAssertions implementation="boolean" default-value="true">${enableAssertions}</enableAssertions> + <enableProcessChecker implementation="java.lang.String">${failsafe.enableProcessChecker}</enableProcessChecker> + <encoding implementation="java.lang.String" default-value="${project.reporting.outputEncoding}">${encoding}</encoding> + <excludedEnvironmentVariables implementation="java.lang.String[]">${failsafe.excludedEnvironmentVariables}</excludedEnvironmentVariables> + <excludedGroups implementation="java.lang.String">${excludedGroups}</excludedGroups> + <excludeJUnit5Engines implementation="java.lang.String[]">${failsafe.excludeJUnit5Engines}</excludeJUnit5Engines> + <excludes implementation="java.util.List">${failsafe.excludes}</excludes> + <excludesFile implementation="java.io.File">${failsafe.excludesFile}</excludesFile> + <failIfNoSpecifiedTests implementation="boolean" default-value="true">${failsafe.failIfNoSpecifiedTests}</failIfNoSpecifiedTests> + <failIfNoSpecifiedTestsDeprecated implementation="boolean" default-value="true">${it.failIfNoSpecifiedTests}</failIfNoSpecifiedTestsDeprecated> + <failIfNoTests implementation="boolean" default-value="false">${failIfNoTests}</failIfNoTests> + <forkCount implementation="java.lang.String" default-value="1">${forkCount}</forkCount> + <forkedProcessExitTimeoutInSeconds implementation="int" default-value="30">${failsafe.exitTimeout}</forkedProcessExitTimeoutInSeconds> + <forkedProcessTimeoutInSeconds implementation="int">${failsafe.timeout}</forkedProcessTimeoutInSeconds> + <forkNode implementation="org.apache.maven.surefire.extensions.ForkNodeFactory">${failsafe.forkNode}</forkNode> + <groups implementation="java.lang.String">${groups}</groups> + <includeJUnit5Engines implementation="java.lang.String[]">${failsafe.includeJUnit5Engines}</includeJUnit5Engines> + <includes implementation="java.util.List">${failsafe.includes}</includes> + <includesFile implementation="java.io.File">${failsafe.includesFile}</includesFile> + <junitArtifactName implementation="java.lang.String" default-value="junit:junit">${junitArtifactName}</junitArtifactName> + <jvm implementation="java.lang.String">${jvm}</jvm> + <objectFactory implementation="java.lang.String">${objectFactory}</objectFactory> + <parallel implementation="java.lang.String">${parallel}</parallel> + <parallelOptimized implementation="boolean" default-value="true">${parallelOptimized}</parallelOptimized> + <parallelTestsTimeoutForcedInSeconds implementation="double">${failsafe.parallel.forcedTimeout}</parallelTestsTimeoutForcedInSeconds> + <parallelTestsTimeoutInSeconds implementation="double">${failsafe.parallel.timeout}</parallelTestsTimeoutInSeconds> + <perCoreThreadCount implementation="boolean" default-value="true">${perCoreThreadCount}</perCoreThreadCount> + <printSummary implementation="boolean" default-value="true">${failsafe.printSummary}</printSummary> + <redirectTestOutputToFile implementation="boolean" default-value="false">${maven.test.redirectTestOutputToFile}</redirectTestOutputToFile> + <reportFormat implementation="java.lang.String" default-value="brief">${failsafe.reportFormat}</reportFormat> + <reportNameSuffix implementation="java.lang.String" default-value="">${surefire.reportNameSuffix}</reportNameSuffix> + <reportsDirectory implementation="java.io.File" default-value="${project.build.directory}/failsafe-reports"/> + <rerunFailingTestsCount implementation="int" default-value="0">${failsafe.rerunFailingTestsCount}</rerunFailingTestsCount> + <reuseForks implementation="boolean" default-value="true">${reuseForks}</reuseForks> + <runOrder implementation="java.lang.String" default-value="filesystem">${failsafe.runOrder}</runOrder> + <runOrderRandomSeed implementation="java.lang.Long">${failsafe.runOrder.random.seed}</runOrderRandomSeed> + <shutdown implementation="java.lang.String" default-value="exit">${failsafe.shutdown}</shutdown> + <skip implementation="boolean" default-value="false">${maven.test.skip}</skip> + <skipAfterFailureCount implementation="int" default-value="0">${failsafe.skipAfterFailureCount}</skipAfterFailureCount> + <skipExec implementation="boolean">${maven.test.skip.exec}</skipExec> + <skipITs implementation="boolean">${skipITs}</skipITs> + <skipTests implementation="boolean" default-value="false">${skipTests}</skipTests> + <suiteXmlFiles implementation="java.io.File[]">${failsafe.suiteXmlFiles}</suiteXmlFiles> + <summaryFile implementation="java.io.File" default-value="${project.build.directory}/failsafe-reports/failsafe-summary.xml"/> + <systemPropertiesFile implementation="java.io.File">${failsafe.systemPropertiesFile}</systemPropertiesFile> + <tempDir implementation="java.lang.String" default-value="surefire">${tempDir}</tempDir> + <test implementation="java.lang.String">${it.test}</test> + <testClassesDirectory implementation="java.io.File" default-value="${project.build.testOutputDirectory}"/> + <testNGArtifactName implementation="java.lang.String" default-value="org.testng:testng">${testNGArtifactName}</testNGArtifactName> + <testSourceDirectory implementation="java.io.File" default-value="${project.build.testSourceDirectory}"/> + <threadCount implementation="int">${threadCount}</threadCount> + <threadCountClasses implementation="int" default-value="0">${threadCountClasses}</threadCountClasses> + <threadCountMethods implementation="int" default-value="0">${threadCountMethods}</threadCountMethods> + <threadCountSuites implementation="int" default-value="0">${threadCountSuites}</threadCountSuites> + <trimStackTrace implementation="boolean" default-value="false">${trimStackTrace}</trimStackTrace> + <useFile implementation="boolean" default-value="true">${failsafe.useFile}</useFile> + <useManifestOnlyJar implementation="boolean" default-value="true">${failsafe.useManifestOnlyJar}</useManifestOnlyJar> + <useModulePath implementation="boolean" default-value="true">${failsafe.useModulePath}</useModulePath> + <useSystemClassLoader implementation="boolean" default-value="true">${failsafe.useSystemClassLoader}</useSystemClassLoader> + <useUnlimitedThreads implementation="boolean" default-value="false">${useUnlimitedThreads}</useUnlimitedThreads> + <workingDirectory implementation="java.io.File">${basedir}</workingDirectory> + </configuration> + </mojo> + <mojo> + <goal>verify</goal> + <description>Verify integration tests ran using Surefire.</description> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>true</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <phase>verify</phase> + <implementation>org.apache.maven.plugin.failsafe.VerifyMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <threadSafe>true</threadSafe> + <parameters> + <parameter> + <name>basedir</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>The base directory of the project being tested. This can be obtained in your unit test by System.getProperty("basedir").</description> + </parameter> + <parameter> + <name>encoding</name> + <type>java.lang.String</type> + <deprecated>since of 2.20.1</deprecated> + <required>false</required> + <editable>true</editable> + <description>The character encoding scheme to be applied. Deprecated since 2.20.1 and used encoding UTF-8 in failsafe-summary.xml.</description> + </parameter> + <parameter> + <name>failIfNoTests</name> + <type>boolean</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to cause a failure if there are no tests to run. Defaults to "false".</description> + </parameter> + <parameter> + <name>failOnFlakeCount</name> + <type>int</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>reportsDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>Base directory where all reports are written to.</description> + </parameter> + <parameter> + <name>skip</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>skipExec</name> + <type>boolean</type> + <since>2.3</since> + <deprecated>Use -DskipTests instead.</deprecated> + <required>false</required> + <editable>true</editable> + <description>This old parameter is just like skipTests, but bound to the old property maven.test.skip.exec.</description> + </parameter> + <parameter> + <name>skipITs</name> + <type>boolean</type> + <since>2.4.3-alpha-2</since> + <required>false</required> + <editable>true</editable> + <description>Set this to 'true' to skip running integration tests, but still compile them. Its use is NOT RECOMMENDED, but quite convenient on occasion.</description> + </parameter> + <parameter> + <name>skipTests</name> + <type>boolean</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>Set this to 'true' to skip running tests, but still compile them. Its use is NOT RECOMMENDED, but quite convenient on occasion.</description> + </parameter> + <parameter> + <name>summaryFile</name> + <type>java.io.File</type> + <required>true</required> + <editable>true</editable> + <description>The summary file to read integration test results from.</description> + </parameter> + <parameter> + <name>summaryFiles</name> + <type>java.io.File[]</type> + <since>2.6</since> + <required>false</required> + <editable>true</editable> + <description>Additional summary files to read integration test results from.</description> + </parameter> + <parameter> + <name>testClassesDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>The directory containing generated test classes of the project being tested. This will be included at the beginning the test classpath.</description> + </parameter> + <parameter> + <name>testFailureIgnore</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Set this to true to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion.</description> + </parameter> + </parameters> + <configuration> + <basedir implementation="java.io.File" default-value="${basedir}"/> + <encoding implementation="java.lang.String" default-value="${project.reporting.outputEncoding}">${encoding}</encoding> + <failIfNoTests implementation="boolean" default-value="false">${failIfNoTests}</failIfNoTests> + <failOnFlakeCount implementation="int" default-value="0">${failsafe.failOnFlakeCount}</failOnFlakeCount> + <reportsDirectory implementation="java.io.File" default-value="${project.build.directory}/failsafe-reports"/> + <skip implementation="boolean" default-value="false">${maven.test.skip}</skip> + <skipExec implementation="boolean">${maven.test.skip.exec}</skipExec> + <skipITs implementation="boolean">${skipITs}</skipITs> + <skipTests implementation="boolean">${skipTests}</skipTests> + <summaryFile implementation="java.io.File" default-value="${project.build.directory}/failsafe-reports/failsafe-summary.xml"/> + <testClassesDirectory implementation="java.io.File" default-value="${project.build.testOutputDirectory}"/> + <testFailureIgnore implementation="boolean" default-value="false">${maven.test.failure.ignore}</testFailureIgnore> + </configuration> + </mojo> + </mojos> +</plugin> \ No newline at end of file --- /dev/null +++ b/maven-failsafe-plugin/src/main/filtered-resources/META-INF/maven/plugin.xml @@ -0,0 +1,1262 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- Generated by maven-plugin-tools 3.9--> + +<plugin> + <name>${project.name}</name> + <description>${project.description}</description> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + <goalPrefix>failsafe</goalPrefix> + <isolatedRealm>false</isolatedRealm> + <inheritedByDefault>true</inheritedByDefault> + <requiredJavaVersion>1.8</requiredJavaVersion> + <requiredMavenVersion>3.2.5</requiredMavenVersion> + <mojos> + <mojo> + <goal>help</goal> + <description>Display help information on maven-failsafe-plugin. +Call mvn failsafe:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.</description> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>false</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <implementation>org.apache.maven.plugins.maven_failsafe_plugin.HelpMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <threadSafe>true</threadSafe> + <parameters> + <parameter> + <name>detail</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>If true, display all settable properties for each goal.</description> + </parameter> + <parameter> + <name>goal</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>The name of the goal for which to show help. If unspecified, all goals will be displayed.</description> + </parameter> + <parameter> + <name>indentSize</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>The number of spaces per indentation level, should be positive.</description> + </parameter> + <parameter> + <name>lineLength</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>The maximum length of a display line, should be positive.</description> + </parameter> + </parameters> + <configuration> + <detail implementation="boolean" default-value="false">${detail}</detail> + <goal implementation="java.lang.String">${goal}</goal> + <indentSize implementation="int" default-value="2">${indentSize}</indentSize> + <lineLength implementation="int" default-value="80">${lineLength}</lineLength> + </configuration> + </mojo> + <mojo> + <goal>integration-test</goal> + <description>Run integration tests using Surefire.</description> + <requiresDependencyResolution>test</requiresDependencyResolution> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>true</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <phase>integration-test</phase> + <implementation>org.apache.maven.plugin.failsafe.IntegrationTestMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <threadSafe>true</threadSafe> + <parameters> + <parameter> + <name>additionalClasspathDependencies</name> + <type>java.util.List</type> + <since>3.2</since> + <required>false</required> + <editable>true</editable> + <description>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. </description> + </parameter> + <parameter> + <name>additionalClasspathElements</name> + <type>java.lang.String[]</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>argLine</name> + <type>java.lang.String</type> + <since>2.1</since> + <required>false</required> + <editable>true</editable> + <description>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></description> + </parameter> + <parameter> + <name>basedir</name> + <type>java.io.File</type> + <required>true</required> + <editable>false</editable> + <description>The base directory of the project being tested. This can be obtained in your integration test via System.getProperty("basedir").</description> + </parameter> + <parameter> + <name>childDelegation</name> + <type>boolean</type> + <since>2.1</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>classesDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>The path representing project JAR file, if exists; Otherwise the directory containing generated classes of the project being tested. This will be included after the test classes in the test classpath. Defaults to built artifact JAR file or ${project.build.outputDirectory}.</description> + </parameter> + <parameter> + <name>classpathDependencyExcludes</name> + <type>java.lang.String[]</type> + <since>2.6</since> + <required>false</required> + <editable>true</editable> + <description>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!</description> + </parameter> + <parameter> + <name>classpathDependencyScopeExclude</name> + <type>java.lang.String</type> + <since>2.6</since> + <required>false</required> + <editable>true</editable> + <description>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 </description> + </parameter> + <parameter> + <name>consoleOutputReporter</name> + <type>org.apache.maven.plugin.surefire.extensions.SurefireConsoleOutputReporter</type> + <required>false</required> + <editable>true</editable> + <description></description> + </parameter> + <parameter> + <name>debugForkedProcess</name> + <type>java.lang.String</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>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 debugging ability options (without overwriting the other options specified through the argLine parameter).</description> + </parameter> + <parameter> + <name>defaultClassesDirectory</name> + <type>java.io.File</type> + <required>true</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>dependenciesToScan</name> + <type>java.lang.String[]</type> + <since>2.15</since> + <required>false</required> + <editable>true</editable> + <description>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. +</description> + </parameter> + <parameter> + <name>disableXmlReport</name> + <type>boolean</type> + <since>2.2</since> + <deprecated>No reason given</deprecated> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>enableAssertions</name> + <type>boolean</type> + <since>2.3.1</since> + <required>false</required> + <editable>true</editable> + <description>By default, Surefire enables JVM assertions for the execution of your test cases. To disable the assertions, set this flag to "false".</description> + </parameter> + <parameter> + <name>enableProcessChecker</name> + <type>java.lang.String</type> + <since>3.0.0-M4</since> + <required>false</required> + <editable>true</editable> + <description>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 -Dfailsafe.enableProcessChecker=all</description> + </parameter> + <parameter> + <name>encoding</name> + <type>java.lang.String</type> + <since>3.0.0-M1</since> + <required>false</required> + <editable>true</editable> + <description>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 still encoded with JVM's encoding used in standard out/err pipes.</description> + </parameter> + <parameter> + <name>environmentVariables</name> + <type>java.util.Map</type> + <since>2.1.3</since> + <required>false</required> + <editable>true</editable> + <description>Additional environment variables to set on the command line.</description> + </parameter> + <parameter> + <name>excludeJUnit5Engines</name> + <type>java.lang.String[]</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>Provide the ID/s of an JUnit engine to be excluded in the test run.</description> + </parameter> + <parameter> + <name>excludedEnvironmentVariables</name> + <type>java.lang.String[]</type> + <since>3.0.0-M4</since> + <required>false</required> + <editable>true</editable> + <description>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 -Dfailsafe.excludedEnvironmentVariables=ACME1,ACME2,ACME3</description> + </parameter> + <parameter> + <name>excludedGroups</name> + <type>java.lang.String</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>excludes</name> + <type>java.util.List</type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>excludesFile</name> + <type>java.io.File</type> + <since>2.13</since> + <required>false</required> + <editable>true</editable> + <description>A file containing exclude patterns, each in a next line. Blank lines, or lines starting with # are ignored. If excludes are also specified, these patterns are appended. Example with path, simple and regex excludes: */it/* **/DontRunIT.* %regex[.*IT.*|.*Not.*] +Since 3.0.0-M6, method filtering support is provided in the exclusions file as well, example: pkg.SomeIT#testMethod </description> + </parameter> + <parameter> + <name>failIfNoSpecifiedTests</name> + <type>boolean</type> + <since>3.0.0-M8</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "false" to prevent a failure if none of the tests specified in -Dit.test=... are run. Defaults to "true". Replacing "it.failIfNoSpecifiedTests" to be consistent with surefire plugin.</description> + </parameter> + <parameter> + <name>failIfNoSpecifiedTestsDeprecated</name> + <type>boolean</type> + <since>2.12</since> + <deprecated>Since 3.0.0-M8, use "failsafe.failIfNoSpecifiedTests" instead.</deprecated> + <required>false</required> + <editable>true</editable> + <description>Set this to "false" to prevent a failure if none of the tests specified in -Dit.test=... are run. Defaults to "true".</description> + </parameter> + <parameter> + <name>failIfNoTests</name> + <type>boolean</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to cause a failure if there are no tests to run. Defaults to "false".</description> + </parameter> + <parameter> + <name>forkCount</name> + <type>java.lang.String</type> + <since>2.14</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>forkNode</name> + <type>org.apache.maven.surefire.extensions.ForkNodeFactory</type> + <since>3.0.0-M5</since> + <required>false</required> + <editable>true</editable> + <description>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></description> + </parameter> + <parameter> + <name>forkedProcessExitTimeoutInSeconds</name> + <type>int</type> + <since>2.20</since> + <required>false</required> + <editable>true</editable> + <description>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-failsafe-plugin/examples/shutdown.html <http://maven.apache.org/surefire/maven-failsafe-plugin/examples/shutdown.html></description> + </parameter> + <parameter> + <name>forkedProcessTimeoutInSeconds</name> + <type>int</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>Kill the forked test process after a certain number of seconds. If set to 0, wait forever for the process, never timing out.</description> + </parameter> + <parameter> + <name>groups</name> + <type>java.lang.String</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>includeJUnit5Engines</name> + <type>java.lang.String[]</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>Provide the ID/s of an JUnit engine to be included in the test run.</description> + </parameter> + <parameter> + <name>includes</name> + <type>java.util.List</type> + <required>false</required> + <editable>true</editable> + <description>A list of <include> elements specifying the test filter (by pattern) of tests which should be included in testing. If it is not specified and the test parameter is unspecified as well, the default includes is <includes> <include>**/IT*.java</include> <include>**/*IT.java</include> <include>**/*ITCase.java</include> </includes> +Each include item may also contain a comma-separated sublist 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.</description> + </parameter> + <parameter> + <name>includesFile</name> + <type>java.io.File</type> + <since>2.13</since> + <required>false</required> + <editable>true</editable> + <description>A file containing include patterns, each in a next line. Blank lines, or lines starting with # are ignored. If includes are also specified, these patterns are appended. Example with path, simple and regex includes: */it/* **/NotIncludedByDefault.java %regex[.*IT.*|.*Not.*] +Since 3.0.0-M6, method filtering support is provided in the inclusions file as well, example: pkg.SomeIT#testMethod </description> + </parameter> + <parameter> + <name>jdkToolchain</name> + <type>java.util.Map</type> + <since>3.0.0-M5 and Maven 3.3.x</since> + <required>false</required> + <editable>true</editable> + <description> +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> </description> + </parameter> + <parameter> + <name>junitArtifactName</name> + <type>java.lang.String</type> + <since>2.3.1</since> + <required>false</required> + <editable>true</editable> + <description>Allows you to specify the name of the JUnit artifact. If not set, junit:junit will be used.</description> + </parameter> + <parameter> + <name>jvm</name> + <type>java.lang.String</type> + <since>2.1</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>objectFactory</name> + <type>java.lang.String</type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>(TestNG only) Define the factory class used to create all test instances.</description> + </parameter> + <parameter> + <name>parallel</name> + <type>java.lang.String</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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).</description> + </parameter> + <parameter> + <name>parallelMavenExecution</name> + <type>java.lang.Boolean</type> + <required>false</required> + <editable>false</editable> + <description>Parallel Maven Execution.</description> + </parameter> + <parameter> + <name>parallelOptimized</name> + <type>boolean</type> + <since>2.17</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>parallelTestsTimeoutForcedInSeconds</name> + <type>double</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>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".</description> + </parameter> + <parameter> + <name>parallelTestsTimeoutInSeconds</name> + <type>double</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>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".</description> + </parameter> + <parameter> + <name>perCoreThreadCount</name> + <type>boolean</type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>(JUnit 4.7 provider) Indicates that threadCount, threadCountSuites, threadCountClasses, threadCountMethods are per cpu core.</description> + </parameter> + <parameter> + <name>pluginArtifactMap</name> + <type>java.util.Map</type> + <required>true</required> + <editable>false</editable> + <description>Map of plugin artifacts.</description> + </parameter> + <parameter> + <name>pluginDescriptor</name> + <type>org.apache.maven.plugin.descriptor.PluginDescriptor</type> + <since>2.12</since> + <required>true</required> + <editable>false</editable> + <description>Information about this plugin, mainly used to lookup this plugin's configuration from the currently executing project.</description> + </parameter> + <parameter> + <name>printSummary</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Option to print summary of test suites or just print the test cases that have errors.</description> + </parameter> + <parameter> + <name>project</name> + <type>org.apache.maven.project.MavenProject</type> + <required>true</required> + <editable>false</editable> + <description>The Maven Project Object.</description> + </parameter> + <parameter> + <name>projectArtifactMap</name> + <type>java.util.Map</type> + <required>true</required> + <editable>false</editable> + <description>Map of project artifacts.</description> + </parameter> + <parameter> + <name>projectBuildDirectory</name> + <type>java.io.File</type> + <since>2.20</since> + <required>true</required> + <editable>false</editable> + <description>Read-only parameter with value of Maven property project.build.directory.</description> + </parameter> + <parameter> + <name>properties</name> + <type>java.util.Properties</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>List of properties for configuring all TestNG related configurations. This is the new preferred method of configuring TestNG.</description> + </parameter> + <parameter> + <name>redirectTestOutputToFile</name> + <type>boolean</type> + <since>2.3</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to redirect the unit test standard output to a file (found in reportsDirectory/testName-output.txt).</description> + </parameter> + <parameter> + <name>reportFormat</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>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)</description> + </parameter> + <parameter> + <name>reportNameSuffix</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>reportsDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>Base directory where all reports are written to.</description> + </parameter> + <parameter> + <name>rerunFailingTestsCount</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>reuseForks</name> + <type>boolean</type> + <since>2.13</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>runOrder</name> + <type>java.lang.String</type> + <since>2.7</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>runOrderRandomSeed</name> + <type>java.lang.Long</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>Sets the random seed that will be used to order the tests if failsafe.runOrder is set to random. + +If no seeds are set and failsafe.runOrder is set to random, then the seed used will be outputted (search for "To reproduce ordering use flag -Dfailsafe.runOrder.random.seed"). + +To deterministically reproduce any random test order that was run before, simply set the seed to be the same value.</description> + </parameter> + <parameter> + <name>session</name> + <type>org.apache.maven.execution.MavenSession</type> + <required>true</required> + <editable>false</editable> + <description>The current build session instance.</description> + </parameter> + <parameter> + <name>shutdown</name> + <type>java.lang.String</type> + <since>2.19</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>skip</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>skipAfterFailureCount</name> + <type>int</type> + <since>2.19</since> + <required>false</required> + <editable>true</editable> + <description>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 -Dfailsafe.skipAfterFailureCount=1 or any number greater than zero. Defaults to "0". +See the prerequisites and limitations in documentation: +http://maven.apache.org/plugins/maven-failsafe-plugin/examples/skip-after-failure.html <http://maven.apache.org/plugins/maven-failsafe-plugin/examples/skip-after-failure.html></description> + </parameter> + <parameter> + <name>skipExec</name> + <type>boolean</type> + <since>2.3</since> + <deprecated>Use skipTests instead.</deprecated> + <required>false</required> + <editable>true</editable> + <description>This old parameter is just like skipTests, but bound to the old property "maven.test.skip.exec".</description> + </parameter> + <parameter> + <name>skipITs</name> + <type>boolean</type> + <since>2.4.3-alpha-2</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to skip running integration tests, but still compile them. Its use is NOT RECOMMENDED, but quite convenient on occasion.</description> + </parameter> + <parameter> + <name>skipTests</name> + <type>boolean</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>statelessTestsetInfoReporter</name> + <type>org.apache.maven.plugin.surefire.extensions.SurefireStatelessTestsetInfoReporter</type> + <required>false</required> + <editable>true</editable> + <description></description> + </parameter> + <parameter> + <name>statelessTestsetReporter</name> + <type>org.apache.maven.plugin.surefire.extensions.SurefireStatelessReporter</type> + <required>false</required> + <editable>true</editable> + <description>Note: use the legacy system property disableXmlReport set to true to disable the report.</description> + </parameter> + <parameter> + <name>suiteXmlFiles</name> + <type>java.io.File[]</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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).</description> + </parameter> + <parameter> + <name>summaryFile</name> + <type>java.io.File</type> + <required>true</required> + <editable>true</editable> + <description>The summary file to write integration test results to.</description> + </parameter> + <parameter> + <name>systemProperties</name> + <type>java.util.Properties</type> + <deprecated>Use systemPropertyVariables instead.</deprecated> + <required>false</required> + <editable>true</editable> + <description>List of System properties to pass to a provider.</description> + </parameter> + <parameter> + <name>systemPropertiesFile</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description></description> + </parameter> + <parameter> + <name>systemPropertyVariables</name> + <type>java.util.Map</type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>List of System properties to pass to a provider.</description> + </parameter> + <parameter> + <name>tempDir</name> + <type>java.lang.String</type> + <since>2.20</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>test</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>Specify this parameter to run individual tests by file name, overriding parameter includes and excludes. Each pattern you specify here will be used to create an include pattern formatted like **/${it.test}.java, so you can just type -Dit.test=MyIT to run a single test file called "foo/MyIT.java". The test patterns prefixed with a ! will be excluded. +This parameter overrides the parameter includes and excludes, and the TestNG parameter suiteXmlFiles. +Since 2.7.3 You can execute a limited number of methods in the test with adding #myMethod or #my*ethod. E.g. type -Dit.test=MyIT#myMethod supported for junit 4.x and TestNg. +Since 2.19 a complex syntax is supported in one parameter (JUnit 4, JUnit 4.7+, TestNG): "-Dit.test=???IT, !Unstable*, pkg/**/Ci*leIT.java, *IT#test*One+testTwo?????, #fast*+slowTest" or e.g. +"-Dit.test=Basic*, !%regex[.*.Unstable.*], !%regex[.*.MyIT.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:*].</description> + </parameter> + <parameter> + <name>testClassesDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>The directory containing generated test classes of the project being tested. This will be included at the beginning of the test classpath.</description> + </parameter> + <parameter> + <name>testNGArtifactName</name> + <type>java.lang.String</type> + <since>2.3.1</since> + <required>false</required> + <editable>true</editable> + <description>Allows you to specify the name of the TestNG artifact. If not set, org.testng:testng will be used.</description> + </parameter> + <parameter> + <name>testSourceDirectory</name> + <type>java.io.File</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>The test source directory containing test class sources. Important only for TestNG HTML reports.</description> + </parameter> + <parameter> + <name>threadCount</name> + <type>int</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>threadCountClasses</name> + <type>int</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>threadCountMethods</name> + <type>int</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>threadCountSuites</name> + <type>int</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>trimStackTrace</name> + <type>boolean</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>Whether to trim the stack trace in the reports to just the lines within the test, or show the full trace.</description> + </parameter> + <parameter> + <name>useFile</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Option to generate a file test report or just output the test report to the console.</description> + </parameter> + <parameter> + <name>useManifestOnlyJar</name> + <type>boolean</type> + <since>2.4.3</since> + <required>false</required> + <editable>true</editable> + <description>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-failsafe-plugin/examples/class-loading.html <http://maven.apache.org/plugins/maven-failsafe-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.</description> + </parameter> + <parameter> + <name>useModulePath</name> + <type>boolean</type> + <since>3.0.0-M2</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>useSystemClassLoader</name> + <type>boolean</type> + <since>2.3</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>useUnlimitedThreads</name> + <type>boolean</type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>(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".</description> + </parameter> + <parameter> + <name>workingDirectory</name> + <type>java.io.File</type> + <since>2.1.3</since> + <required>false</required> + <editable>true</editable> + <description>Command line working directory.</description> + </parameter> + </parameters> + <configuration> + <additionalClasspathDependencies implementation="java.util.List">${maven.test.additionalClasspathDependencies}</additionalClasspathDependencies> + <additionalClasspathElements implementation="java.lang.String[]">${maven.test.additionalClasspath}</additionalClasspathElements> + <argLine implementation="java.lang.String">${argLine}</argLine> + <basedir implementation="java.io.File" default-value="${basedir}"/> + <childDelegation implementation="boolean" default-value="false">${childDelegation}</childDelegation> + <classpathDependencyExcludes implementation="java.lang.String[]">${maven.test.dependency.excludes}</classpathDependencyExcludes> + <debugForkedProcess implementation="java.lang.String">${maven.failsafe.debug}</debugForkedProcess> + <defaultClassesDirectory implementation="java.io.File" default-value="${project.build.outputDirectory}"/> + <dependenciesToScan implementation="java.lang.String[]">${dependenciesToScan}</dependenciesToScan> + <disableXmlReport implementation="boolean" default-value="false">${disableXmlReport}</disableXmlReport> + <enableAssertions implementation="boolean" default-value="true">${enableAssertions}</enableAssertions> + <enableProcessChecker implementation="java.lang.String">${failsafe.enableProcessChecker}</enableProcessChecker> + <encoding implementation="java.lang.String" default-value="${project.reporting.outputEncoding}">${encoding}</encoding> + <excludeJUnit5Engines implementation="java.lang.String[]">${failsafe.excludeJUnit5Engines}</excludeJUnit5Engines> + <excludedEnvironmentVariables implementation="java.lang.String[]">${failsafe.excludedEnvironmentVariables}</excludedEnvironmentVariables> + <excludedGroups implementation="java.lang.String">${excludedGroups}</excludedGroups> + <excludes implementation="java.util.List">${failsafe.excludes}</excludes> + <excludesFile implementation="java.io.File">${failsafe.excludesFile}</excludesFile> + <failIfNoSpecifiedTests implementation="boolean" default-value="true">${failsafe.failIfNoSpecifiedTests}</failIfNoSpecifiedTests> + <failIfNoSpecifiedTestsDeprecated implementation="boolean" default-value="true">${it.failIfNoSpecifiedTests}</failIfNoSpecifiedTestsDeprecated> + <failIfNoTests implementation="boolean" default-value="false">${failIfNoTests}</failIfNoTests> + <forkCount implementation="java.lang.String" default-value="1">${forkCount}</forkCount> + <forkNode implementation="org.apache.maven.surefire.extensions.ForkNodeFactory">${failsafe.forkNode}</forkNode> + <forkedProcessExitTimeoutInSeconds implementation="int" default-value="30">${failsafe.exitTimeout}</forkedProcessExitTimeoutInSeconds> + <forkedProcessTimeoutInSeconds implementation="int">${failsafe.timeout}</forkedProcessTimeoutInSeconds> + <groups implementation="java.lang.String">${groups}</groups> + <includeJUnit5Engines implementation="java.lang.String[]">${failsafe.includeJUnit5Engines}</includeJUnit5Engines> + <includes implementation="java.util.List">${failsafe.includes}</includes> + <includesFile implementation="java.io.File">${failsafe.includesFile}</includesFile> + <junitArtifactName implementation="java.lang.String" default-value="junit:junit">${junitArtifactName}</junitArtifactName> + <jvm implementation="java.lang.String">${jvm}</jvm> + <objectFactory implementation="java.lang.String">${objectFactory}</objectFactory> + <parallel implementation="java.lang.String">${parallel}</parallel> + <parallelMavenExecution implementation="java.lang.Boolean" default-value="${session.parallel}"/> + <parallelOptimized implementation="boolean" default-value="true">${parallelOptimized}</parallelOptimized> + <parallelTestsTimeoutForcedInSeconds implementation="double">${failsafe.parallel.forcedTimeout}</parallelTestsTimeoutForcedInSeconds> + <parallelTestsTimeoutInSeconds implementation="double">${failsafe.parallel.timeout}</parallelTestsTimeoutInSeconds> + <perCoreThreadCount implementation="boolean" default-value="true">${perCoreThreadCount}</perCoreThreadCount> + <pluginArtifactMap implementation="java.util.Map">${plugin.artifactMap}</pluginArtifactMap> + <pluginDescriptor implementation="org.apache.maven.plugin.descriptor.PluginDescriptor" default-value="${plugin}"/> + <printSummary implementation="boolean" default-value="true">${failsafe.printSummary}</printSummary> + <project implementation="org.apache.maven.project.MavenProject" default-value="${project}"/> + <projectArtifactMap implementation="java.util.Map">${project.artifactMap}</projectArtifactMap> + <projectBuildDirectory implementation="java.io.File" default-value="${project.build.directory}"/> + <redirectTestOutputToFile implementation="boolean" default-value="false">${maven.test.redirectTestOutputToFile}</redirectTestOutputToFile> + <reportFormat implementation="java.lang.String" default-value="brief">${failsafe.reportFormat}</reportFormat> + <reportNameSuffix implementation="java.lang.String" default-value="">${surefire.reportNameSuffix}</reportNameSuffix> + <reportsDirectory implementation="java.io.File" default-value="${project.build.directory}/failsafe-reports"/> + <rerunFailingTestsCount implementation="int" default-value="0">${failsafe.rerunFailingTestsCount}</rerunFailingTestsCount> + <reuseForks implementation="boolean" default-value="true">${reuseForks}</reuseForks> + <runOrder implementation="java.lang.String" default-value="filesystem">${failsafe.runOrder}</runOrder> + <runOrderRandomSeed implementation="java.lang.Long">${failsafe.runOrder.random.seed}</runOrderRandomSeed> + <session implementation="org.apache.maven.execution.MavenSession" default-value="${session}"/> + <shutdown implementation="java.lang.String" default-value="exit">${failsafe.shutdown}</shutdown> + <skip implementation="boolean" default-value="false">${maven.test.skip}</skip> + <skipAfterFailureCount implementation="int" default-value="0">${failsafe.skipAfterFailureCount}</skipAfterFailureCount> + <skipExec implementation="boolean">${maven.test.skip.exec}</skipExec> + <skipITs implementation="boolean">${skipITs}</skipITs> + <skipTests implementation="boolean" default-value="false">${skipTests}</skipTests> + <suiteXmlFiles implementation="java.io.File[]">${failsafe.suiteXmlFiles}</suiteXmlFiles> + <summaryFile implementation="java.io.File" default-value="${project.build.directory}/failsafe-reports/failsafe-summary.xml"/> + <systemPropertiesFile implementation="java.io.File">${failsafe.systemPropertiesFile}</systemPropertiesFile> + <tempDir implementation="java.lang.String" default-value="surefire">${tempDir}</tempDir> + <test implementation="java.lang.String">${it.test}</test> + <testClassesDirectory implementation="java.io.File" default-value="${project.build.testOutputDirectory}"/> + <testNGArtifactName implementation="java.lang.String" default-value="org.testng:testng">${testNGArtifactName}</testNGArtifactName> + <testSourceDirectory implementation="java.io.File" default-value="${project.build.testSourceDirectory}"/> + <threadCount implementation="int">${threadCount}</threadCount> + <threadCountClasses implementation="int" default-value="0">${threadCountClasses}</threadCountClasses> + <threadCountMethods implementation="int" default-value="0">${threadCountMethods}</threadCountMethods> + <threadCountSuites implementation="int" default-value="0">${threadCountSuites}</threadCountSuites> + <trimStackTrace implementation="boolean" default-value="false">${trimStackTrace}</trimStackTrace> + <useFile implementation="boolean" default-value="true">${failsafe.useFile}</useFile> + <useManifestOnlyJar implementation="boolean" default-value="true">${failsafe.useManifestOnlyJar}</useManifestOnlyJar> + <useModulePath implementation="boolean" default-value="true">${failsafe.useModulePath}</useModulePath> + <useSystemClassLoader implementation="boolean" default-value="true">${failsafe.useSystemClassLoader}</useSystemClassLoader> + <useUnlimitedThreads implementation="boolean" default-value="false">${useUnlimitedThreads}</useUnlimitedThreads> + <workingDirectory implementation="java.io.File">${basedir}</workingDirectory> + </configuration> + <requirements> + <requirement> + <role>org.codehaus.plexus.languages.java.jpms.LocationManager</role> + <field-name>locationManager</field-name> + </requirement> + <requirement> + <role>org.codehaus.plexus.logging.Logger</role> + <field-name>logger</field-name> + </requirement> + <requirement> + <role>org.apache.maven.surefire.providerapi.ProviderDetector</role> + <field-name>providerDetector</field-name> + </requirement> + <requirement> + <role>org.apache.maven.plugin.surefire.SurefireDependencyResolver</role> + <field-name>surefireDependencyResolver</field-name> + </requirement> + <requirement> + <role>org.apache.maven.toolchain.ToolchainManager</role> + <field-name>toolchainManager</field-name> + </requirement> + </requirements> + </mojo> + <mojo> + <goal>verify</goal> + <description>Verify integration tests ran using Surefire.</description> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>true</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <phase>verify</phase> + <implementation>org.apache.maven.plugin.failsafe.VerifyMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <threadSafe>true</threadSafe> + <parameters> + <parameter> + <name>basedir</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>The base directory of the project being tested. This can be obtained in your unit test by System.getProperty("basedir").</description> + </parameter> + <parameter> + <name>encoding</name> + <type>java.lang.String</type> + <deprecated>since of 2.20.1</deprecated> + <required>false</required> + <editable>true</editable> + <description>The character encoding scheme to be applied. Deprecated since 2.20.1 and used encoding UTF-8 in failsafe-summary.xml.</description> + </parameter> + <parameter> + <name>failIfNoTests</name> + <type>boolean</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to cause a failure if there are no tests to run. Defaults to "false".</description> + </parameter> + <parameter> + <name>failOnFlakeCount</name> + <type>int</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>reportsDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>Base directory where all reports are written to.</description> + </parameter> + <parameter> + <name>session</name> + <type>org.apache.maven.execution.MavenSession</type> + <required>false</required> + <editable>false</editable> + <description>The current build session instance.</description> + </parameter> + <parameter> + <name>skip</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>skipExec</name> + <type>boolean</type> + <since>2.3</since> + <deprecated>Use -DskipTests instead.</deprecated> + <required>false</required> + <editable>true</editable> + <description>This old parameter is just like skipTests, but bound to the old property maven.test.skip.exec.</description> + </parameter> + <parameter> + <name>skipITs</name> + <type>boolean</type> + <since>2.4.3-alpha-2</since> + <required>false</required> + <editable>true</editable> + <description>Set this to 'true' to skip running integration tests, but still compile them. Its use is NOT RECOMMENDED, but quite convenient on occasion.</description> + </parameter> + <parameter> + <name>skipTests</name> + <type>boolean</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>Set this to 'true' to skip running tests, but still compile them. Its use is NOT RECOMMENDED, but quite convenient on occasion.</description> + </parameter> + <parameter> + <name>summaryFile</name> + <type>java.io.File</type> + <required>true</required> + <editable>true</editable> + <description>The summary file to read integration test results from.</description> + </parameter> + <parameter> + <name>summaryFiles</name> + <type>java.io.File[]</type> + <since>2.6</since> + <required>false</required> + <editable>true</editable> + <description>Additional summary files to read integration test results from.</description> + </parameter> + <parameter> + <name>testClassesDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>The directory containing generated test classes of the project being tested. This will be included at the beginning the test classpath.</description> + </parameter> + <parameter> + <name>testFailureIgnore</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Set this to true to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion.</description> + </parameter> + </parameters> + <configuration> + <basedir implementation="java.io.File" default-value="${basedir}"/> + <encoding implementation="java.lang.String" default-value="${project.reporting.outputEncoding}">${encoding}</encoding> + <failIfNoTests implementation="boolean" default-value="false">${failIfNoTests}</failIfNoTests> + <failOnFlakeCount implementation="int" default-value="0">${failsafe.failOnFlakeCount}</failOnFlakeCount> + <reportsDirectory implementation="java.io.File" default-value="${project.build.directory}/failsafe-reports"/> + <session implementation="org.apache.maven.execution.MavenSession" default-value="${session}"/> + <skip implementation="boolean" default-value="false">${maven.test.skip}</skip> + <skipExec implementation="boolean">${maven.test.skip.exec}</skipExec> + <skipITs implementation="boolean">${skipITs}</skipITs> + <skipTests implementation="boolean">${skipTests}</skipTests> + <summaryFile implementation="java.io.File" default-value="${project.build.directory}/failsafe-reports/failsafe-summary.xml"/> + <testClassesDirectory implementation="java.io.File" default-value="${project.build.testOutputDirectory}"/> + <testFailureIgnore implementation="boolean" default-value="false">${maven.test.failure.ignore}</testFailureIgnore> + </configuration> + <requirements> + <requirement> + <role>org.codehaus.plexus.logging.Logger</role> + <field-name>logger</field-name> + </requirement> + </requirements> + </mojo> + </mojos> + <dependencies> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>maven-surefire-common</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-api</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-logger-api</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-extensions-api</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-booter</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-extensions-spi</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>org.eclipse.aether</groupId> + <artifactId>aether-util</artifactId> + <type>jar</type> + <version>1.0.0.v20140518</version> + </dependency> + <dependency> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-common-artifact-filters</artifactId> + <type>jar</type> + <version>3.1.1</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-java</artifactId> + <type>jar</type> + <version>1.2.0</version> + </dependency> + <dependency> + <groupId>org.ow2.asm</groupId> + <artifactId>asm</artifactId> + <type>jar</type> + <version>9.2</version> + </dependency> + <dependency> + <groupId>com.thoughtworks.qdox</groupId> + <artifactId>qdox</artifactId> + <type>jar</type> + <version>2.0.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-shared-utils</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <type>jar</type> + <version>2.15.1</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-compress</artifactId> + <type>jar</type> + <version>1.25.0</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <type>jar</type> + <version>1.7.36</version> + </dependency> + <dependency> + <groupId>org.apache.maven.resolver</groupId> + <artifactId>maven-resolver-api</artifactId> + <type>jar</type> + <version>1.9.18</version> + </dependency> + <dependency> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-shared-utils</artifactId> + <type>jar</type> + <version>3.3.4</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <type>jar</type> + <version>3.14.0</version> + </dependency> + </dependencies> +</plugin> \ No newline at end of file --- /dev/null +++ b/maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/maven_failsafe_plugin/HelpMojo.java @@ -0,0 +1,448 @@ +package org.apache.maven.plugins.maven_failsafe_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-failsafe-plugin.<br> + * Call <code>mvn failsafe:help -Ddetail=true -Dgoal=<goal-name></code> to display parameter details. + * @author maven-plugin-tools + */ +@Mojo( name = "help", requiresProject = false, threadSafe = true ) +public class HelpMojo + extends AbstractMojo +{ + /** + * If <code>true</code>, 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/<groupId>/<artifactId>/plugin-help.xml + private static final String PLUGIN_HELP_PATH = + "/META-INF/maven/org.apache.maven.plugins/maven-failsafe-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 ); + + //<goalPrefix>plugin</goalPrefix> + String goalPrefix = getValue( plugin, "goalPrefix" ); + + Node mojos1 = getSingleChild( plugin, "mojos" ); + + List<Node> 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<Node> 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<Node> findNamedChild( Node node, String elementName ) + { + List<Node> result = new ArrayList<Node>(); + 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<Node> 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<Node> 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 ); + } + + /** + * <p>Repeat a String <code>n</code> times to form a new string.</p> + * + * @param str String to repeat + * @param repeat number of times to repeat str + * @return String with repeated String + * @throws NegativeArraySizeException if <code>repeat < 0</code> + * @throws NullPointerException if str is <code>null</code> + */ + 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. + * <b>Note</b>: The last character is always a new line. + * + * @param sb The buffer to append the description, not <code>null</code>. + * @param description The description, not <code>null</code>. + * @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 <code>null</code>. + * @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 <code>null</code>. + * @throws NegativeArraySizeException if <code>indent < 0</code> + */ + private static List<String> toLines( String text, int indent, int indentSize, int lineLength ) + { + List<String> lines = new ArrayList<String>(); + + 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 <code>null</code>. + * @param line The line to add, must not be <code>null</code>. + * @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<String> 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 <code>null</code>. + * @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 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- Generated by maven-plugin-tools 3.9 (for help'mojo with additional elements)--> + +<plugin> + <name>${project.name}</name> + <description>${project.description}</description> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + <goalPrefix>surefire</goalPrefix> + <mojos> + <mojo> + <goal>help</goal> + <description>Display help information on maven-surefire-plugin. +Call mvn surefire:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.</description> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>false</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <implementation>org.apache.maven.plugins.maven_surefire_plugin.HelpMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <threadSafe>true</threadSafe> + <parameters> + <parameter> + <name>detail</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>If true, display all settable properties for each goal.</description> + </parameter> + <parameter> + <name>goal</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>The name of the goal for which to show help. If unspecified, all goals will be displayed.</description> + </parameter> + <parameter> + <name>indentSize</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>The number of spaces per indentation level, should be positive.</description> + </parameter> + <parameter> + <name>lineLength</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>The maximum length of a display line, should be positive.</description> + </parameter> + </parameters> + <configuration> + <detail implementation="boolean" default-value="false">${detail}</detail> + <goal implementation="java.lang.String">${goal}</goal> + <indentSize implementation="int" default-value="2">${indentSize}</indentSize> + <lineLength implementation="int" default-value="80">${lineLength}</lineLength> + </configuration> + </mojo> + <mojo> + <goal>test</goal> + <description>Run tests using Surefire.</description> + <requiresDependencyResolution>test</requiresDependencyResolution> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>true</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <phase>test</phase> + <implementation>org.apache.maven.plugin.surefire.SurefirePlugin</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <threadSafe>true</threadSafe> + <parameters> + <parameter> + <name>additionalClasspathDependencies</name> + <type>java.util.List<org.apache.maven.model.Dependency></type> + <since>3.2</since> + <required>false</required> + <editable>true</editable> + <description>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. </description> + </parameter> + <parameter> + <name>additionalClasspathElements</name> + <type>java.lang.String[]</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>argLine</name> + <type>java.lang.String</type> + <since>2.1</since> + <required>false</required> + <editable>true</editable> + <description>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></description> + </parameter> + <parameter> + <name>childDelegation</name> + <type>boolean</type> + <since>2.1</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>classesDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>The directory containing generated classes of the project being tested. This will be included after the test classes in the test classpath.</description> + </parameter> + <parameter> + <name>classpathDependencyExcludes</name> + <type>java.lang.String[]</type> + <since>2.6</since> + <required>false</required> + <editable>true</editable> + <description>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!</description> + </parameter> + <parameter> + <name>classpathDependencyScopeExclude</name> + <type>java.lang.String</type> + <since>2.6</since> + <required>false</required> + <editable>true</editable> + <description>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 </description> + </parameter> + <parameter> + <name>consoleOutputReporter</name> + <type>org.apache.maven.plugin.surefire.extensions.SurefireConsoleOutputReporter</type> + <required>false</required> + <editable>true</editable> + <description></description> + </parameter> + <parameter> + <name>debugForkedProcess</name> + <type>java.lang.String</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>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).</description> + </parameter> + <parameter> + <name>dependenciesToScan</name> + <type>java.lang.String[]</type> + <since>2.15</since> + <required>false</required> + <editable>true</editable> + <description>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. +</description> + </parameter> + <parameter> + <name>disableXmlReport</name> + <type>boolean</type> + <since>2.2</since> + <deprecated>No reason given</deprecated> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>enableAssertions</name> + <type>boolean</type> + <since>2.3.1</since> + <required>false</required> + <editable>true</editable> + <description>By default, Surefire enables JVM assertions for the execution of your test cases. To disable the assertions, set this flag to "false".</description> + </parameter> + <parameter> + <name>enableProcessChecker</name> + <type>java.lang.String</type> + <since>3.0.0-M4</since> + <required>false</required> + <editable>true</editable> + <description>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</description> + </parameter> + <parameter> + <name>encoding</name> + <type>java.lang.String</type> + <since>3.0.0-M1</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>environmentVariables</name> + <type>java.util.Map<java.lang.String, java.lang.String></type> + <since>2.1.3</since> + <required>false</required> + <editable>true</editable> + <description>Additional environment variables to set on the command line.</description> + </parameter> + <parameter> + <name>excludedEnvironmentVariables</name> + <type>java.lang.String[]</type> + <since>3.0.0-M4</since> + <required>false</required> + <editable>true</editable> + <description>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</description> + </parameter> + <parameter> + <name>excludedGroups</name> + <type>java.lang.String</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>excludeJUnit5Engines</name> + <type>java.lang.String[]</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>Provide the ID/s of an JUnit engine to be excluded in the test run.</description> + </parameter> + <parameter> + <name>excludes</name> + <type>java.util.List<java.lang.String></type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>excludesFile</name> + <type>java.io.File</type> + <since>2.13</since> + <required>false</required> + <editable>true</editable> + <description>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 </description> + </parameter> + <parameter> + <name>failIfNoSpecifiedTests</name> + <type>boolean</type> + <since>2.12</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to cause a failure if none of the tests specified in -Dtest=... are run. Defaults to "true".</description> + </parameter> + <parameter> + <name>failIfNoTests</name> + <type>boolean</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to cause a failure if there are no tests to run. Defaults to "false".</description> + </parameter> + <parameter> + <name>failOnFlakeCount</name> + <type>int</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>forkCount</name> + <type>java.lang.String</type> + <since>2.14</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>forkedProcessExitTimeoutInSeconds</name> + <type>int</type> + <since>2.20</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>forkedProcessTimeoutInSeconds</name> + <type>int</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>Kill the forked test process after a certain number of seconds. If set to 0, wait forever for the process, never timing out.</description> + </parameter> + <parameter> + <name>forkNode</name> + <type>org.apache.maven.surefire.extensions.ForkNodeFactory</type> + <since>3.0.0-M5</since> + <required>false</required> + <editable>true</editable> + <description>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></description> + </parameter> + <parameter> + <name>groups</name> + <type>java.lang.String</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>includeJUnit5Engines</name> + <type>java.lang.String[]</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>Provide the ID/s of an JUnit engine to be included in the test run.</description> + </parameter> + <parameter> + <name>includes</name> + <type>java.util.List<java.lang.String></type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>includesFile</name> + <type>java.io.File</type> + <since>2.13</since> + <required>false</required> + <editable>true</editable> + <description>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 </description> + </parameter> + <parameter> + <name>jdkToolchain</name> + <type>java.util.Map<java.lang.String, java.lang.String></type> + <since>3.0.0-M5 and Maven 3.3.x</since> + <required>false</required> + <editable>true</editable> + <description> +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> </description> + </parameter> + <parameter> + <name>junitArtifactName</name> + <type>java.lang.String</type> + <since>2.3.1</since> + <required>false</required> + <editable>true</editable> + <description>Allows you to specify the name of the JUnit artifact. If not set, junit:junit will be used.</description> + </parameter> + <parameter> + <name>jvm</name> + <type>java.lang.String</type> + <since>2.1</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>objectFactory</name> + <type>java.lang.String</type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>(TestNG only) Define the factory class used to create all test instances.</description> + </parameter> + <parameter> + <name>parallel</name> + <type>java.lang.String</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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).</description> + </parameter> + <parameter> + <name>parallelOptimized</name> + <type>boolean</type> + <since>2.17</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>parallelTestsTimeoutForcedInSeconds</name> + <type>double</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>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".</description> + </parameter> + <parameter> + <name>parallelTestsTimeoutInSeconds</name> + <type>double</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>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".</description> + </parameter> + <parameter> + <name>perCoreThreadCount</name> + <type>boolean</type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>(JUnit 4.7 provider) Indicates that threadCount, threadCountSuites, threadCountClasses, threadCountMethods are per cpu core.</description> + </parameter> + <parameter> + <name>printSummary</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Option to print summary of test suites or just print the test cases that have errors.</description> + </parameter> + <parameter> + <name>properties</name> + <type>java.util.Properties</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>List of properties for configuring all TestNG related configurations. This is the new preferred method of configuring TestNG.</description> + </parameter> + <parameter> + <name>redirectTestOutputToFile</name> + <type>boolean</type> + <since>2.3</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to redirect the unit test standard output to a file (found in reportsDirectory/testName-output.txt).</description> + </parameter> + <parameter> + <name>reportFormat</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>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)</description> + </parameter> + <parameter> + <name>reportNameSuffix</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>reportsDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>Base directory where all reports are written to.</description> + </parameter> + <parameter> + <name>rerunFailingTestsCount</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>reuseForks</name> + <type>boolean</type> + <since>2.13</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>runOrder</name> + <type>java.lang.String</type> + <since>2.7</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>runOrderRandomSeed</name> + <type>java.lang.Long</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>shutdown</name> + <type>java.lang.String</type> + <since>2.19</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>skip</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>skipAfterFailureCount</name> + <type>int</type> + <since>2.19</since> + <required>false</required> + <editable>true</editable> + <description>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></description> + </parameter> + <parameter> + <name>skipExec</name> + <type>boolean</type> + <since>2.3</since> + <deprecated>Use skipTests instead.</deprecated> + <required>false</required> + <editable>true</editable> + <description>This old parameter is just like skipTests, but bound to the old property "maven.test.skip.exec".</description> + </parameter> + <parameter> + <name>skipTests</name> + <type>boolean</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>statelessTestsetInfoReporter</name> + <type>org.apache.maven.plugin.surefire.extensions.SurefireStatelessTestsetInfoReporter</type> + <required>false</required> + <editable>true</editable> + <description></description> + </parameter> + <parameter> + <name>statelessTestsetReporter</name> + <type>org.apache.maven.plugin.surefire.extensions.SurefireStatelessReporter</type> + <required>false</required> + <editable>true</editable> + <description>Note: use the legacy system property disableXmlReport set to true to disable the report.</description> + </parameter> + <parameter> + <name>suiteXmlFiles</name> + <type>java.io.File[]</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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).</description> + </parameter> + <parameter> + <name>systemProperties</name> + <type>java.util.Properties</type> + <deprecated>Use systemPropertyVariables instead.</deprecated> + <required>false</required> + <editable>true</editable> + <description>List of System properties to pass to a provider.</description> + </parameter> + <parameter> + <name>systemPropertiesFile</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description></description> + </parameter> + <parameter> + <name>systemPropertyVariables</name> + <type>java.util.Map<java.lang.String, java.lang.String></type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>List of System properties to pass to a provider.</description> + </parameter> + <parameter> + <name>tempDir</name> + <type>java.lang.String</type> + <since>2.20</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>test</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>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:*].</description> + </parameter> + <parameter> + <name>testClassesDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>The directory containing generated test classes of the project being tested. This will be included at the beginning of the test classpath.</description> + </parameter> + <parameter> + <name>testFailureIgnore</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion.</description> + </parameter> + <parameter> + <name>testNGArtifactName</name> + <type>java.lang.String</type> + <since>2.3.1</since> + <required>false</required> + <editable>true</editable> + <description>Allows you to specify the name of the TestNG artifact. If not set, org.testng:testng will be used.</description> + </parameter> + <parameter> + <name>testSourceDirectory</name> + <type>java.io.File</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>The test source directory containing test class sources. Important only for TestNG HTML reports.</description> + </parameter> + <parameter> + <name>threadCount</name> + <type>int</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>threadCountClasses</name> + <type>int</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>threadCountMethods</name> + <type>int</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>threadCountSuites</name> + <type>int</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>trimStackTrace</name> + <type>boolean</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>Whether to trim the stack trace in the reports to just the lines within the test, or show the full trace.</description> + </parameter> + <parameter> + <name>useFile</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Option to generate a file test report or just output the test report to the console.</description> + </parameter> + <parameter> + <name>useManifestOnlyJar</name> + <type>boolean</type> + <since>2.4.3</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>useModulePath</name> + <type>boolean</type> + <since>3.0.0-M2</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>useSystemClassLoader</name> + <type>boolean</type> + <since>2.3</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>useUnlimitedThreads</name> + <type>boolean</type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>(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".</description> + </parameter> + <parameter> + <name>workingDirectory</name> + <type>java.io.File</type> + <since>2.1.3</since> + <required>false</required> + <editable>true</editable> + <description>Command line working directory.</description> + </parameter> + </parameters> + <configuration> + <additionalClasspathDependencies implementation="java.util.List">${maven.test.additionalClasspathDependencies}</additionalClasspathDependencies> + <additionalClasspathElements implementation="java.lang.String[]">${maven.test.additionalClasspath}</additionalClasspathElements> + <argLine implementation="java.lang.String">${argLine}</argLine> + <childDelegation implementation="boolean" default-value="false">${childDelegation}</childDelegation> + <classesDirectory implementation="java.io.File" default-value="${project.build.outputDirectory}"/> + <classpathDependencyExcludes implementation="java.lang.String[]">${maven.test.dependency.excludes}</classpathDependencyExcludes> + <debugForkedProcess implementation="java.lang.String">${maven.surefire.debug}</debugForkedProcess> + <dependenciesToScan implementation="java.lang.String[]">${dependenciesToScan}</dependenciesToScan> + <disableXmlReport implementation="boolean" default-value="false">${disableXmlReport}</disableXmlReport> + <enableAssertions implementation="boolean" default-value="true">${enableAssertions}</enableAssertions> + <enableProcessChecker implementation="java.lang.String">${surefire.enableProcessChecker}</enableProcessChecker> + <encoding implementation="java.lang.String" default-value="${project.reporting.outputEncoding}">${surefire.encoding}</encoding> + <excludedEnvironmentVariables implementation="java.lang.String[]">${surefire.excludedEnvironmentVariables}</excludedEnvironmentVariables> + <excludedGroups implementation="java.lang.String">${excludedGroups}</excludedGroups> + <excludeJUnit5Engines implementation="java.lang.String[]">${surefire.excludeJUnit5Engines}</excludeJUnit5Engines> + <excludes implementation="java.util.List">${surefire.excludes}</excludes> + <excludesFile implementation="java.io.File">${surefire.excludesFile}</excludesFile> + <failIfNoSpecifiedTests implementation="boolean" default-value="true">${surefire.failIfNoSpecifiedTests}</failIfNoSpecifiedTests> + <failIfNoTests implementation="boolean" default-value="false">${failIfNoTests}</failIfNoTests> + <failOnFlakeCount implementation="int" default-value="0">${surefire.failOnFlakeCount}</failOnFlakeCount> + <forkCount implementation="java.lang.String" default-value="1">${forkCount}</forkCount> + <forkedProcessExitTimeoutInSeconds implementation="int" default-value="30">${surefire.exitTimeout}</forkedProcessExitTimeoutInSeconds> + <forkedProcessTimeoutInSeconds implementation="int">${surefire.timeout}</forkedProcessTimeoutInSeconds> + <forkNode implementation="org.apache.maven.surefire.extensions.ForkNodeFactory">${surefire.forkNode}</forkNode> + <groups implementation="java.lang.String">${groups}</groups> + <includeJUnit5Engines implementation="java.lang.String[]">${surefire.includeJUnit5Engines}</includeJUnit5Engines> + <includes implementation="java.util.List">${surefire.includes}</includes> + <includesFile implementation="java.io.File">${surefire.includesFile}</includesFile> + <junitArtifactName implementation="java.lang.String" default-value="junit:junit">${junitArtifactName}</junitArtifactName> + <jvm implementation="java.lang.String">${jvm}</jvm> + <objectFactory implementation="java.lang.String">${objectFactory}</objectFactory> + <parallel implementation="java.lang.String">${parallel}</parallel> + <parallelOptimized implementation="boolean" default-value="true">${parallelOptimized}</parallelOptimized> + <parallelTestsTimeoutForcedInSeconds implementation="double">${surefire.parallel.forcedTimeout}</parallelTestsTimeoutForcedInSeconds> + <parallelTestsTimeoutInSeconds implementation="double">${surefire.parallel.timeout}</parallelTestsTimeoutInSeconds> + <perCoreThreadCount implementation="boolean" default-value="true">${perCoreThreadCount}</perCoreThreadCount> + <printSummary implementation="boolean" default-value="true">${surefire.printSummary}</printSummary> + <redirectTestOutputToFile implementation="boolean" default-value="false">${maven.test.redirectTestOutputToFile}</redirectTestOutputToFile> + <reportFormat implementation="java.lang.String" default-value="brief">${surefire.reportFormat}</reportFormat> + <reportNameSuffix implementation="java.lang.String" default-value="">${surefire.reportNameSuffix}</reportNameSuffix> + <reportsDirectory implementation="java.io.File" default-value="${project.build.directory}/surefire-reports"/> + <rerunFailingTestsCount implementation="int" default-value="0">${surefire.rerunFailingTestsCount}</rerunFailingTestsCount> + <reuseForks implementation="boolean" default-value="true">${reuseForks}</reuseForks> + <runOrder implementation="java.lang.String" default-value="filesystem">${surefire.runOrder}</runOrder> + <runOrderRandomSeed implementation="java.lang.Long">${surefire.runOrder.random.seed}</runOrderRandomSeed> + <shutdown implementation="java.lang.String" default-value="exit">${surefire.shutdown}</shutdown> + <skip implementation="boolean" default-value="false">${maven.test.skip}</skip> + <skipAfterFailureCount implementation="int" default-value="0">${surefire.skipAfterFailureCount}</skipAfterFailureCount> + <skipExec implementation="boolean">${maven.test.skip.exec}</skipExec> + <skipTests implementation="boolean" default-value="false">${skipTests}</skipTests> + <suiteXmlFiles implementation="java.io.File[]">${surefire.suiteXmlFiles}</suiteXmlFiles> + <systemPropertiesFile implementation="java.io.File">${surefire.systemPropertiesFile}</systemPropertiesFile> + <tempDir implementation="java.lang.String" default-value="surefire">${tempDir}</tempDir> + <test implementation="java.lang.String">${test}</test> + <testClassesDirectory implementation="java.io.File" default-value="${project.build.testOutputDirectory}"/> + <testFailureIgnore implementation="boolean" default-value="false">${maven.test.failure.ignore}</testFailureIgnore> + <testNGArtifactName implementation="java.lang.String" default-value="org.testng:testng">${testNGArtifactName}</testNGArtifactName> + <testSourceDirectory implementation="java.io.File" default-value="${project.build.testSourceDirectory}"/> + <threadCount implementation="int">${threadCount}</threadCount> + <threadCountClasses implementation="int" default-value="0">${threadCountClasses}</threadCountClasses> + <threadCountMethods implementation="int" default-value="0">${threadCountMethods}</threadCountMethods> + <threadCountSuites implementation="int" default-value="0">${threadCountSuites}</threadCountSuites> + <trimStackTrace implementation="boolean" default-value="false">${trimStackTrace}</trimStackTrace> + <useFile implementation="boolean" default-value="true">${surefire.useFile}</useFile> + <useManifestOnlyJar implementation="boolean" default-value="true">${surefire.useManifestOnlyJar}</useManifestOnlyJar> + <useModulePath implementation="boolean" default-value="true">${surefire.useModulePath}</useModulePath> + <useSystemClassLoader implementation="boolean" default-value="true">${surefire.useSystemClassLoader}</useSystemClassLoader> + <useUnlimitedThreads implementation="boolean" default-value="false">${useUnlimitedThreads}</useUnlimitedThreads> + <workingDirectory implementation="java.io.File">${basedir}</workingDirectory> + </configuration> + </mojo> + </mojos> +</plugin> \ 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 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- Generated by maven-plugin-tools 3.9--> + +<plugin> + <name>${project.name}</name> + <description>${project.description}</description> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + <goalPrefix>surefire</goalPrefix> + <isolatedRealm>false</isolatedRealm> + <inheritedByDefault>true</inheritedByDefault> + <requiredJavaVersion>1.8</requiredJavaVersion> + <requiredMavenVersion>3.2.5</requiredMavenVersion> + <mojos> + <mojo> + <goal>help</goal> + <description>Display help information on maven-surefire-plugin. +Call mvn surefire:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.</description> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>false</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <implementation>org.apache.maven.plugins.maven_surefire_plugin.HelpMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <threadSafe>true</threadSafe> + <parameters> + <parameter> + <name>detail</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>If true, display all settable properties for each goal.</description> + </parameter> + <parameter> + <name>goal</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>The name of the goal for which to show help. If unspecified, all goals will be displayed.</description> + </parameter> + <parameter> + <name>indentSize</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>The number of spaces per indentation level, should be positive.</description> + </parameter> + <parameter> + <name>lineLength</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>The maximum length of a display line, should be positive.</description> + </parameter> + </parameters> + <configuration> + <detail implementation="boolean" default-value="false">${detail}</detail> + <goal implementation="java.lang.String">${goal}</goal> + <indentSize implementation="int" default-value="2">${indentSize}</indentSize> + <lineLength implementation="int" default-value="80">${lineLength}</lineLength> + </configuration> + </mojo> + <mojo> + <goal>test</goal> + <description>Run tests using Surefire.</description> + <requiresDependencyResolution>test</requiresDependencyResolution> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>true</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <phase>test</phase> + <implementation>org.apache.maven.plugin.surefire.SurefirePlugin</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <threadSafe>true</threadSafe> + <parameters> + <parameter> + <name>additionalClasspathDependencies</name> + <type>java.util.List</type> + <since>3.2</since> + <required>false</required> + <editable>true</editable> + <description>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. </description> + </parameter> + <parameter> + <name>additionalClasspathElements</name> + <type>java.lang.String[]</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>argLine</name> + <type>java.lang.String</type> + <since>2.1</since> + <required>false</required> + <editable>true</editable> + <description>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></description> + </parameter> + <parameter> + <name>basedir</name> + <type>java.io.File</type> + <required>true</required> + <editable>false</editable> + <description>The base directory of the project being tested. This can be obtained in your integration test via System.getProperty("basedir").</description> + </parameter> + <parameter> + <name>childDelegation</name> + <type>boolean</type> + <since>2.1</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>classesDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>The directory containing generated classes of the project being tested. This will be included after the test classes in the test classpath.</description> + </parameter> + <parameter> + <name>classpathDependencyExcludes</name> + <type>java.lang.String[]</type> + <since>2.6</since> + <required>false</required> + <editable>true</editable> + <description>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!</description> + </parameter> + <parameter> + <name>classpathDependencyScopeExclude</name> + <type>java.lang.String</type> + <since>2.6</since> + <required>false</required> + <editable>true</editable> + <description>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 </description> + </parameter> + <parameter> + <name>consoleOutputReporter</name> + <type>org.apache.maven.plugin.surefire.extensions.SurefireConsoleOutputReporter</type> + <required>false</required> + <editable>true</editable> + <description></description> + </parameter> + <parameter> + <name>debugForkedProcess</name> + <type>java.lang.String</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>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).</description> + </parameter> + <parameter> + <name>dependenciesToScan</name> + <type>java.lang.String[]</type> + <since>2.15</since> + <required>false</required> + <editable>true</editable> + <description>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. +</description> + </parameter> + <parameter> + <name>disableXmlReport</name> + <type>boolean</type> + <since>2.2</since> + <deprecated>No reason given</deprecated> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>enableAssertions</name> + <type>boolean</type> + <since>2.3.1</since> + <required>false</required> + <editable>true</editable> + <description>By default, Surefire enables JVM assertions for the execution of your test cases. To disable the assertions, set this flag to "false".</description> + </parameter> + <parameter> + <name>enableProcessChecker</name> + <type>java.lang.String</type> + <since>3.0.0-M4</since> + <required>false</required> + <editable>true</editable> + <description>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</description> + </parameter> + <parameter> + <name>encoding</name> + <type>java.lang.String</type> + <since>3.0.0-M1</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>environmentVariables</name> + <type>java.util.Map</type> + <since>2.1.3</since> + <required>false</required> + <editable>true</editable> + <description>Additional environment variables to set on the command line.</description> + </parameter> + <parameter> + <name>excludeJUnit5Engines</name> + <type>java.lang.String[]</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>Provide the ID/s of an JUnit engine to be excluded in the test run.</description> + </parameter> + <parameter> + <name>excludedEnvironmentVariables</name> + <type>java.lang.String[]</type> + <since>3.0.0-M4</since> + <required>false</required> + <editable>true</editable> + <description>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</description> + </parameter> + <parameter> + <name>excludedGroups</name> + <type>java.lang.String</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>excludes</name> + <type>java.util.List</type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>excludesFile</name> + <type>java.io.File</type> + <since>2.13</since> + <required>false</required> + <editable>true</editable> + <description>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 </description> + </parameter> + <parameter> + <name>failIfNoSpecifiedTests</name> + <type>boolean</type> + <since>2.12</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to cause a failure if none of the tests specified in -Dtest=... are run. Defaults to "true".</description> + </parameter> + <parameter> + <name>failIfNoTests</name> + <type>boolean</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to cause a failure if there are no tests to run. Defaults to "false".</description> + </parameter> + <parameter> + <name>failOnFlakeCount</name> + <type>int</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>forkCount</name> + <type>java.lang.String</type> + <since>2.14</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>forkNode</name> + <type>org.apache.maven.surefire.extensions.ForkNodeFactory</type> + <since>3.0.0-M5</since> + <required>false</required> + <editable>true</editable> + <description>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></description> + </parameter> + <parameter> + <name>forkedProcessExitTimeoutInSeconds</name> + <type>int</type> + <since>2.20</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>forkedProcessTimeoutInSeconds</name> + <type>int</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>Kill the forked test process after a certain number of seconds. If set to 0, wait forever for the process, never timing out.</description> + </parameter> + <parameter> + <name>groups</name> + <type>java.lang.String</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>includeJUnit5Engines</name> + <type>java.lang.String[]</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>Provide the ID/s of an JUnit engine to be included in the test run.</description> + </parameter> + <parameter> + <name>includes</name> + <type>java.util.List</type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>includesFile</name> + <type>java.io.File</type> + <since>2.13</since> + <required>false</required> + <editable>true</editable> + <description>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 </description> + </parameter> + <parameter> + <name>jdkToolchain</name> + <type>java.util.Map</type> + <since>3.0.0-M5 and Maven 3.3.x</since> + <required>false</required> + <editable>true</editable> + <description> +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> </description> + </parameter> + <parameter> + <name>junitArtifactName</name> + <type>java.lang.String</type> + <since>2.3.1</since> + <required>false</required> + <editable>true</editable> + <description>Allows you to specify the name of the JUnit artifact. If not set, junit:junit will be used.</description> + </parameter> + <parameter> + <name>jvm</name> + <type>java.lang.String</type> + <since>2.1</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>objectFactory</name> + <type>java.lang.String</type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>(TestNG only) Define the factory class used to create all test instances.</description> + </parameter> + <parameter> + <name>parallel</name> + <type>java.lang.String</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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).</description> + </parameter> + <parameter> + <name>parallelMavenExecution</name> + <type>java.lang.Boolean</type> + <required>false</required> + <editable>false</editable> + <description>Parallel Maven Execution.</description> + </parameter> + <parameter> + <name>parallelOptimized</name> + <type>boolean</type> + <since>2.17</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>parallelTestsTimeoutForcedInSeconds</name> + <type>double</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>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".</description> + </parameter> + <parameter> + <name>parallelTestsTimeoutInSeconds</name> + <type>double</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>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".</description> + </parameter> + <parameter> + <name>perCoreThreadCount</name> + <type>boolean</type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>(JUnit 4.7 provider) Indicates that threadCount, threadCountSuites, threadCountClasses, threadCountMethods are per cpu core.</description> + </parameter> + <parameter> + <name>pluginArtifactMap</name> + <type>java.util.Map</type> + <required>true</required> + <editable>false</editable> + <description>Map of plugin artifacts.</description> + </parameter> + <parameter> + <name>pluginDescriptor</name> + <type>org.apache.maven.plugin.descriptor.PluginDescriptor</type> + <since>2.12</since> + <required>true</required> + <editable>false</editable> + <description>Information about this plugin, mainly used to lookup this plugin's configuration from the currently executing project.</description> + </parameter> + <parameter> + <name>printSummary</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Option to print summary of test suites or just print the test cases that have errors.</description> + </parameter> + <parameter> + <name>project</name> + <type>org.apache.maven.project.MavenProject</type> + <required>true</required> + <editable>false</editable> + <description>The Maven Project Object.</description> + </parameter> + <parameter> + <name>projectArtifactMap</name> + <type>java.util.Map</type> + <required>true</required> + <editable>false</editable> + <description>Map of project artifacts.</description> + </parameter> + <parameter> + <name>projectBuildDirectory</name> + <type>java.io.File</type> + <since>2.20</since> + <required>true</required> + <editable>false</editable> + <description>Read-only parameter with value of Maven property project.build.directory.</description> + </parameter> + <parameter> + <name>properties</name> + <type>java.util.Properties</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>List of properties for configuring all TestNG related configurations. This is the new preferred method of configuring TestNG.</description> + </parameter> + <parameter> + <name>redirectTestOutputToFile</name> + <type>boolean</type> + <since>2.3</since> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to redirect the unit test standard output to a file (found in reportsDirectory/testName-output.txt).</description> + </parameter> + <parameter> + <name>reportFormat</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>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)</description> + </parameter> + <parameter> + <name>reportNameSuffix</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>reportsDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>Base directory where all reports are written to.</description> + </parameter> + <parameter> + <name>rerunFailingTestsCount</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>reuseForks</name> + <type>boolean</type> + <since>2.13</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>runOrder</name> + <type>java.lang.String</type> + <since>2.7</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>runOrderRandomSeed</name> + <type>java.lang.Long</type> + <since>3.0.0-M6</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>session</name> + <type>org.apache.maven.execution.MavenSession</type> + <required>true</required> + <editable>false</editable> + <description>The current build session instance.</description> + </parameter> + <parameter> + <name>shutdown</name> + <type>java.lang.String</type> + <since>2.19</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>skip</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>skipAfterFailureCount</name> + <type>int</type> + <since>2.19</since> + <required>false</required> + <editable>true</editable> + <description>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></description> + </parameter> + <parameter> + <name>skipExec</name> + <type>boolean</type> + <since>2.3</since> + <deprecated>Use skipTests instead.</deprecated> + <required>false</required> + <editable>true</editable> + <description>This old parameter is just like skipTests, but bound to the old property "maven.test.skip.exec".</description> + </parameter> + <parameter> + <name>skipTests</name> + <type>boolean</type> + <since>2.4</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>statelessTestsetInfoReporter</name> + <type>org.apache.maven.plugin.surefire.extensions.SurefireStatelessTestsetInfoReporter</type> + <required>false</required> + <editable>true</editable> + <description></description> + </parameter> + <parameter> + <name>statelessTestsetReporter</name> + <type>org.apache.maven.plugin.surefire.extensions.SurefireStatelessReporter</type> + <required>false</required> + <editable>true</editable> + <description>Note: use the legacy system property disableXmlReport set to true to disable the report.</description> + </parameter> + <parameter> + <name>suiteXmlFiles</name> + <type>java.io.File[]</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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).</description> + </parameter> + <parameter> + <name>systemProperties</name> + <type>java.util.Properties</type> + <deprecated>Use systemPropertyVariables instead.</deprecated> + <required>false</required> + <editable>true</editable> + <description>List of System properties to pass to a provider.</description> + </parameter> + <parameter> + <name>systemPropertiesFile</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description></description> + </parameter> + <parameter> + <name>systemPropertyVariables</name> + <type>java.util.Map</type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>List of System properties to pass to a provider.</description> + </parameter> + <parameter> + <name>tempDir</name> + <type>java.lang.String</type> + <since>2.20</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>test</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>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:*].</description> + </parameter> + <parameter> + <name>testClassesDirectory</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>The directory containing generated test classes of the project being tested. This will be included at the beginning of the test classpath.</description> + </parameter> + <parameter> + <name>testFailureIgnore</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Set this to "true" to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion.</description> + </parameter> + <parameter> + <name>testNGArtifactName</name> + <type>java.lang.String</type> + <since>2.3.1</since> + <required>false</required> + <editable>true</editable> + <description>Allows you to specify the name of the TestNG artifact. If not set, org.testng:testng will be used.</description> + </parameter> + <parameter> + <name>testSourceDirectory</name> + <type>java.io.File</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>The test source directory containing test class sources. Important only for TestNG HTML reports.</description> + </parameter> + <parameter> + <name>threadCount</name> + <type>int</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>threadCountClasses</name> + <type>int</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>threadCountMethods</name> + <type>int</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>threadCountSuites</name> + <type>int</type> + <since>2.16</since> + <required>false</required> + <editable>true</editable> + <description>(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.</description> + </parameter> + <parameter> + <name>trimStackTrace</name> + <type>boolean</type> + <since>2.2</since> + <required>false</required> + <editable>true</editable> + <description>Whether to trim the stack trace in the reports to just the lines within the test, or show the full trace.</description> + </parameter> + <parameter> + <name>useFile</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Option to generate a file test report or just output the test report to the console.</description> + </parameter> + <parameter> + <name>useManifestOnlyJar</name> + <type>boolean</type> + <since>2.4.3</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>useModulePath</name> + <type>boolean</type> + <since>3.0.0-M2</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>useSystemClassLoader</name> + <type>boolean</type> + <since>2.3</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>useUnlimitedThreads</name> + <type>boolean</type> + <since>2.5</since> + <required>false</required> + <editable>true</editable> + <description>(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".</description> + </parameter> + <parameter> + <name>workingDirectory</name> + <type>java.io.File</type> + <since>2.1.3</since> + <required>false</required> + <editable>true</editable> + <description>Command line working directory.</description> + </parameter> + </parameters> + <configuration> + <additionalClasspathDependencies implementation="java.util.List">${maven.test.additionalClasspathDependencies}</additionalClasspathDependencies> + <additionalClasspathElements implementation="java.lang.String[]">${maven.test.additionalClasspath}</additionalClasspathElements> + <argLine implementation="java.lang.String">${argLine}</argLine> + <basedir implementation="java.io.File" default-value="${basedir}"/> + <childDelegation implementation="boolean" default-value="false">${childDelegation}</childDelegation> + <classesDirectory implementation="java.io.File" default-value="${project.build.outputDirectory}"/> + <classpathDependencyExcludes implementation="java.lang.String[]">${maven.test.dependency.excludes}</classpathDependencyExcludes> + <debugForkedProcess implementation="java.lang.String">${maven.surefire.debug}</debugForkedProcess> + <dependenciesToScan implementation="java.lang.String[]">${dependenciesToScan}</dependenciesToScan> + <disableXmlReport implementation="boolean" default-value="false">${disableXmlReport}</disableXmlReport> + <enableAssertions implementation="boolean" default-value="true">${enableAssertions}</enableAssertions> + <enableProcessChecker implementation="java.lang.String">${surefire.enableProcessChecker}</enableProcessChecker> + <encoding implementation="java.lang.String" default-value="${project.reporting.outputEncoding}">${surefire.encoding}</encoding> + <excludeJUnit5Engines implementation="java.lang.String[]">${surefire.excludeJUnit5Engines}</excludeJUnit5Engines> + <excludedEnvironmentVariables implementation="java.lang.String[]">${surefire.excludedEnvironmentVariables}</excludedEnvironmentVariables> + <excludedGroups implementation="java.lang.String">${excludedGroups}</excludedGroups> + <excludes implementation="java.util.List">${surefire.excludes}</excludes> + <excludesFile implementation="java.io.File">${surefire.excludesFile}</excludesFile> + <failIfNoSpecifiedTests implementation="boolean" default-value="true">${surefire.failIfNoSpecifiedTests}</failIfNoSpecifiedTests> + <failIfNoTests implementation="boolean" default-value="false">${failIfNoTests}</failIfNoTests> + <failOnFlakeCount implementation="int" default-value="0">${surefire.failOnFlakeCount}</failOnFlakeCount> + <forkCount implementation="java.lang.String" default-value="1">${forkCount}</forkCount> + <forkNode implementation="org.apache.maven.surefire.extensions.ForkNodeFactory">${surefire.forkNode}</forkNode> + <forkedProcessExitTimeoutInSeconds implementation="int" default-value="30">${surefire.exitTimeout}</forkedProcessExitTimeoutInSeconds> + <forkedProcessTimeoutInSeconds implementation="int">${surefire.timeout}</forkedProcessTimeoutInSeconds> + <groups implementation="java.lang.String">${groups}</groups> + <includeJUnit5Engines implementation="java.lang.String[]">${surefire.includeJUnit5Engines}</includeJUnit5Engines> + <includes implementation="java.util.List">${surefire.includes}</includes> + <includesFile implementation="java.io.File">${surefire.includesFile}</includesFile> + <junitArtifactName implementation="java.lang.String" default-value="junit:junit">${junitArtifactName}</junitArtifactName> + <jvm implementation="java.lang.String">${jvm}</jvm> + <objectFactory implementation="java.lang.String">${objectFactory}</objectFactory> + <parallel implementation="java.lang.String">${parallel}</parallel> + <parallelMavenExecution implementation="java.lang.Boolean" default-value="${session.parallel}"/> + <parallelOptimized implementation="boolean" default-value="true">${parallelOptimized}</parallelOptimized> + <parallelTestsTimeoutForcedInSeconds implementation="double">${surefire.parallel.forcedTimeout}</parallelTestsTimeoutForcedInSeconds> + <parallelTestsTimeoutInSeconds implementation="double">${surefire.parallel.timeout}</parallelTestsTimeoutInSeconds> + <perCoreThreadCount implementation="boolean" default-value="true">${perCoreThreadCount}</perCoreThreadCount> + <pluginArtifactMap implementation="java.util.Map">${plugin.artifactMap}</pluginArtifactMap> + <pluginDescriptor implementation="org.apache.maven.plugin.descriptor.PluginDescriptor" default-value="${plugin}"/> + <printSummary implementation="boolean" default-value="true">${surefire.printSummary}</printSummary> + <project implementation="org.apache.maven.project.MavenProject" default-value="${project}"/> + <projectArtifactMap implementation="java.util.Map">${project.artifactMap}</projectArtifactMap> + <projectBuildDirectory implementation="java.io.File" default-value="${project.build.directory}"/> + <redirectTestOutputToFile implementation="boolean" default-value="false">${maven.test.redirectTestOutputToFile}</redirectTestOutputToFile> + <reportFormat implementation="java.lang.String" default-value="brief">${surefire.reportFormat}</reportFormat> + <reportNameSuffix implementation="java.lang.String" default-value="">${surefire.reportNameSuffix}</reportNameSuffix> + <reportsDirectory implementation="java.io.File" default-value="${project.build.directory}/surefire-reports"/> + <rerunFailingTestsCount implementation="int" default-value="0">${surefire.rerunFailingTestsCount}</rerunFailingTestsCount> + <reuseForks implementation="boolean" default-value="true">${reuseForks}</reuseForks> + <runOrder implementation="java.lang.String" default-value="filesystem">${surefire.runOrder}</runOrder> + <runOrderRandomSeed implementation="java.lang.Long">${surefire.runOrder.random.seed}</runOrderRandomSeed> + <session implementation="org.apache.maven.execution.MavenSession" default-value="${session}"/> + <shutdown implementation="java.lang.String" default-value="exit">${surefire.shutdown}</shutdown> + <skip implementation="boolean" default-value="false">${maven.test.skip}</skip> + <skipAfterFailureCount implementation="int" default-value="0">${surefire.skipAfterFailureCount}</skipAfterFailureCount> + <skipExec implementation="boolean">${maven.test.skip.exec}</skipExec> + <skipTests implementation="boolean" default-value="false">${skipTests}</skipTests> + <suiteXmlFiles implementation="java.io.File[]">${surefire.suiteXmlFiles}</suiteXmlFiles> + <systemPropertiesFile implementation="java.io.File">${surefire.systemPropertiesFile}</systemPropertiesFile> + <tempDir implementation="java.lang.String" default-value="surefire">${tempDir}</tempDir> + <test implementation="java.lang.String">${test}</test> + <testClassesDirectory implementation="java.io.File" default-value="${project.build.testOutputDirectory}"/> + <testFailureIgnore implementation="boolean" default-value="false">${maven.test.failure.ignore}</testFailureIgnore> + <testNGArtifactName implementation="java.lang.String" default-value="org.testng:testng">${testNGArtifactName}</testNGArtifactName> + <testSourceDirectory implementation="java.io.File" default-value="${project.build.testSourceDirectory}"/> + <threadCount implementation="int">${threadCount}</threadCount> + <threadCountClasses implementation="int" default-value="0">${threadCountClasses}</threadCountClasses> + <threadCountMethods implementation="int" default-value="0">${threadCountMethods}</threadCountMethods> + <threadCountSuites implementation="int" default-value="0">${threadCountSuites}</threadCountSuites> + <trimStackTrace implementation="boolean" default-value="false">${trimStackTrace}</trimStackTrace> + <useFile implementation="boolean" default-value="true">${surefire.useFile}</useFile> + <useManifestOnlyJar implementation="boolean" default-value="true">${surefire.useManifestOnlyJar}</useManifestOnlyJar> + <useModulePath implementation="boolean" default-value="true">${surefire.useModulePath}</useModulePath> + <useSystemClassLoader implementation="boolean" default-value="true">${surefire.useSystemClassLoader}</useSystemClassLoader> + <useUnlimitedThreads implementation="boolean" default-value="false">${useUnlimitedThreads}</useUnlimitedThreads> + <workingDirectory implementation="java.io.File">${basedir}</workingDirectory> + </configuration> + <requirements> + <requirement> + <role>org.codehaus.plexus.languages.java.jpms.LocationManager</role> + <field-name>locationManager</field-name> + </requirement> + <requirement> + <role>org.codehaus.plexus.logging.Logger</role> + <field-name>logger</field-name> + </requirement> + <requirement> + <role>org.apache.maven.surefire.providerapi.ProviderDetector</role> + <field-name>providerDetector</field-name> + </requirement> + <requirement> + <role>org.apache.maven.plugin.surefire.SurefireDependencyResolver</role> + <field-name>surefireDependencyResolver</field-name> + </requirement> + <requirement> + <role>org.apache.maven.toolchain.ToolchainManager</role> + <field-name>toolchainManager</field-name> + </requirement> + </requirements> + </mojo> + </mojos> + <dependencies> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>maven-surefire-common</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-api</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-logger-api</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-extensions-api</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-booter</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-extensions-spi</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>org.eclipse.aether</groupId> + <artifactId>aether-util</artifactId> + <type>jar</type> + <version>1.0.0.v20140518</version> + </dependency> + <dependency> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-common-artifact-filters</artifactId> + <type>jar</type> + <version>3.1.1</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-java</artifactId> + <type>jar</type> + <version>1.2.0</version> + </dependency> + <dependency> + <groupId>org.ow2.asm</groupId> + <artifactId>asm</artifactId> + <type>jar</type> + <version>9.2</version> + </dependency> + <dependency> + <groupId>com.thoughtworks.qdox</groupId> + <artifactId>qdox</artifactId> + <type>jar</type> + <version>2.0.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-shared-utils</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <type>jar</type> + <version>2.15.1</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-compress</artifactId> + <type>jar</type> + <version>1.25.0</version> + </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-api</artifactId> + <type>jar</type> + <version>1.7.36</version> + </dependency> + <dependency> + <groupId>org.apache.maven.resolver</groupId> + <artifactId>maven-resolver-api</artifactId> + <type>jar</type> + <version>1.9.18</version> + </dependency> + <dependency> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-shared-utils</artifactId> + <type>jar</type> + <version>3.3.4</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <type>jar</type> + <version>3.14.0</version> + </dependency> + </dependencies> +</plugin> \ 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.<br> + * Call <code>mvn surefire:help -Ddetail=true -Dgoal=<goal-name></code> to display parameter details. + * @author maven-plugin-tools + */ +@Mojo( name = "help", requiresProject = false, threadSafe = true ) +public class HelpMojo + extends AbstractMojo +{ + /** + * If <code>true</code>, 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/<groupId>/<artifactId>/plugin-help.xml + private static final String PLUGIN_HELP_PATH = + "/META-INF/maven/org.apache.maven.plugins/maven-surefire-plugin/plugin-help.xml"; + + private static final int DEFAULT_LINE_LENGTH = 80; + + private Document build() + throws MojoExecutionException + { + getLog().debug( "load plugin-help.xml: " + PLUGIN_HELP_PATH ); + 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 ); + + //<goalPrefix>plugin</goalPrefix> + String goalPrefix = getValue( plugin, "goalPrefix" ); + + Node mojos1 = getSingleChild( plugin, "mojos" ); + + List<Node> 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<Node> 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<Node> findNamedChild( Node node, String elementName ) + { + List<Node> result = new ArrayList<Node>(); + 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<Node> 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<Node> 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 ); + } + + /** + * <p>Repeat a String <code>n</code> times to form a new string.</p> + * + * @param str String to repeat + * @param repeat number of times to repeat str + * @return String with repeated String + * @throws NegativeArraySizeException if <code>repeat < 0</code> + * @throws NullPointerException if str is <code>null</code> + */ + 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. + * <b>Note</b>: The last character is always a new line. + * + * @param sb The buffer to append the description, not <code>null</code>. + * @param description The description, not <code>null</code>. + * @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 <code>null</code>. + * @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 <code>null</code>. + * @throws NegativeArraySizeException if <code>indent < 0</code> + */ + private static List<String> toLines( String text, int indent, int indentSize, int lineLength ) + { + List<String> lines = new ArrayList<String>(); + + 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 <code>null</code>. + * @param line The line to add, must not be <code>null</code>. + * @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<String> 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 <code>null</code>. + * @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 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- Generated by maven-plugin-tools 3.9 (for help'mojo with additional elements)--> + +<plugin> + <name>${project.name}</name> + <description>${project.description}</description> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + <goalPrefix>surefire-report</goalPrefix> + <mojos> + <mojo> + <goal>failsafe-report-only</goal> + <description>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></description> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>true</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <implementation>org.apache.maven.plugins.surefire.report.FailsafeReportMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <since>2.10</since> + <threadSafe>false</threadSafe> + <parameters> + <parameter> + <name>aggregate</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Whether to build an aggregated report at the root, or build individual reports.</description> + </parameter> + <parameter> + <name>alwaysGenerateFailsafeReport</name> + <type>boolean</type> + <since>2.11</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>customBundle</name> + <type>java.lang.String</type> + <since>3.1.0</since> + <required>false</required> + <editable>true</editable> + <description>Path for a custom bundle instead of using the default one. +Using this field, you could change the texts in the generated reports.</description> + </parameter> + <parameter> + <name>linkXRef</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Whether to link the XRef if found.</description> + </parameter> + <parameter> + <name>outputName</name> + <type>java.lang.String</type> + <required>true</required> + <editable>true</editable> + <description>The filename to use for the report.</description> + </parameter> + <parameter> + <name>reportsDirectories</name> + <type>java.io.File[]</type> + <required>false</required> + <editable>true</editable> + <description>Directories containing the XML Report files that will be parsed and rendered to HTML format.</description> + </parameter> + <parameter> + <name>reportsDirectory</name> + <type>java.io.File</type> + <deprecated>No reason given</deprecated> + <required>false</required> + <editable>true</editable> + <description>(Deprecated, use reportsDirectories) This directory contains the XML Report files that will be parsed and rendered to HTML format.</description> + </parameter> + <parameter> + <name>showSuccess</name> + <type>boolean</type> + <required>true</required> + <editable>true</editable> + <description>If set to false, only failures are shown.</description> + </parameter> + <parameter> + <name>skipFailsafeReport</name> + <type>boolean</type> + <since>2.11</since> + <required>false</required> + <editable>true</editable> + <description>If set to true the failsafe report generation will be skipped.</description> + </parameter> + <parameter> + <name>xrefLocation</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>Location of the Xrefs to link.</description> + </parameter> + </parameters> + <configuration> + <aggregate implementation="boolean" default-value="false">${aggregate}</aggregate> + <alwaysGenerateFailsafeReport implementation="boolean" default-value="false">${alwaysGenerateFailsafeReport}</alwaysGenerateFailsafeReport> + <customBundle implementation="java.lang.String" default-value="${basedir}/src/site/custom/surefire-report.properties"/> + <linkXRef implementation="boolean" default-value="true">${linkXRef}</linkXRef> + <outputName implementation="java.lang.String" default-value="failsafe-report">${outputName}</outputName> + <showSuccess implementation="boolean" default-value="true">${showSuccess}</showSuccess> + <skipFailsafeReport implementation="boolean" default-value="false">${skipFailsafeReport}</skipFailsafeReport> + <xrefLocation implementation="java.io.File" default-value="${project.reporting.outputDirectory}/xref-test"/> + </configuration> + </mojo> + <mojo> + <goal>help</goal> + <description>Display help information on maven-surefire-report-plugin. +Call mvn surefire-report:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.</description> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>false</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <implementation>org.apache.maven.plugins.maven_surefire_report_plugin.HelpMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <threadSafe>true</threadSafe> + <parameters> + <parameter> + <name>detail</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>If true, display all settable properties for each goal.</description> + </parameter> + <parameter> + <name>goal</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>The name of the goal for which to show help. If unspecified, all goals will be displayed.</description> + </parameter> + <parameter> + <name>indentSize</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>The number of spaces per indentation level, should be positive.</description> + </parameter> + <parameter> + <name>lineLength</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>The maximum length of a display line, should be positive.</description> + </parameter> + </parameters> + <configuration> + <detail implementation="boolean" default-value="false">${detail}</detail> + <goal implementation="java.lang.String">${goal}</goal> + <indentSize implementation="int" default-value="2">${indentSize}</indentSize> + <lineLength implementation="int" default-value="80">${lineLength}</lineLength> + </configuration> + </mojo> + <mojo> + <goal>report</goal> + <description>Creates a nicely formatted Surefire Test Report in html format.</description> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>true</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>false</inheritedByDefault> + <executePhase>test</executePhase> + <executeLifecycle>surefire</executeLifecycle> + <implementation>org.apache.maven.plugins.surefire.report.SurefireReportMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <threadSafe>false</threadSafe> + <parameters> + <parameter> + <name>aggregate</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Whether to build an aggregated report at the root, or build individual reports.</description> + </parameter> + <parameter> + <name>alwaysGenerateSurefireReport</name> + <type>boolean</type> + <since>2.11</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>customBundle</name> + <type>java.lang.String</type> + <since>3.1.0</since> + <required>false</required> + <editable>true</editable> + <description>Path for a custom bundle instead of using the default one. +Using this field, you could change the texts in the generated reports.</description> + </parameter> + <parameter> + <name>linkXRef</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Whether to link the XRef if found.</description> + </parameter> + <parameter> + <name>outputName</name> + <type>java.lang.String</type> + <required>true</required> + <editable>true</editable> + <description>The filename to use for the report.</description> + </parameter> + <parameter> + <name>reportsDirectories</name> + <type>java.io.File[]</type> + <required>false</required> + <editable>true</editable> + <description>Directories containing the XML Report files that will be parsed and rendered to HTML format.</description> + </parameter> + <parameter> + <name>reportsDirectory</name> + <type>java.io.File</type> + <deprecated>No reason given</deprecated> + <required>false</required> + <editable>true</editable> + <description>(Deprecated, use reportsDirectories) This directory contains the XML Report files that will be parsed and rendered to HTML format.</description> + </parameter> + <parameter> + <name>showSuccess</name> + <type>boolean</type> + <required>true</required> + <editable>true</editable> + <description>If set to false, only failures are shown.</description> + </parameter> + <parameter> + <name>skipSurefireReport</name> + <type>boolean</type> + <since>2.11</since> + <required>false</required> + <editable>true</editable> + <description>If set to true the surefire report generation will be skipped.</description> + </parameter> + <parameter> + <name>xrefLocation</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>Location of the Xrefs to link.</description> + </parameter> + </parameters> + <configuration> + <aggregate implementation="boolean" default-value="false">${aggregate}</aggregate> + <alwaysGenerateSurefireReport implementation="boolean" default-value="true">${alwaysGenerateSurefireReport}</alwaysGenerateSurefireReport> + <customBundle implementation="java.lang.String" default-value="${basedir}/src/site/custom/surefire-report.properties"/> + <linkXRef implementation="boolean" default-value="true">${linkXRef}</linkXRef> + <outputName implementation="java.lang.String" default-value="surefire-report">${outputName}</outputName> + <showSuccess implementation="boolean" default-value="true">${showSuccess}</showSuccess> + <skipSurefireReport implementation="boolean" default-value="false">${skipSurefireReport}</skipSurefireReport> + <xrefLocation implementation="java.io.File" default-value="${project.reporting.outputDirectory}/xref-test"/> + </configuration> + </mojo> + <mojo> + <goal>report-only</goal> + <description>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></description> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>true</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <implementation>org.apache.maven.plugins.surefire.report.SurefireReportOnlyMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <since>2.3</since> + <threadSafe>false</threadSafe> + <parameters> + <parameter> + <name>aggregate</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Whether to build an aggregated report at the root, or build individual reports.</description> + </parameter> + <parameter> + <name>alwaysGenerateSurefireReport</name> + <type>boolean</type> + <since>2.11</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>customBundle</name> + <type>java.lang.String</type> + <since>3.1.0</since> + <required>false</required> + <editable>true</editable> + <description>Path for a custom bundle instead of using the default one. +Using this field, you could change the texts in the generated reports.</description> + </parameter> + <parameter> + <name>linkXRef</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Whether to link the XRef if found.</description> + </parameter> + <parameter> + <name>outputName</name> + <type>java.lang.String</type> + <required>true</required> + <editable>true</editable> + <description>The filename to use for the report.</description> + </parameter> + <parameter> + <name>reportsDirectories</name> + <type>java.io.File[]</type> + <required>false</required> + <editable>true</editable> + <description>Directories containing the XML Report files that will be parsed and rendered to HTML format.</description> + </parameter> + <parameter> + <name>reportsDirectory</name> + <type>java.io.File</type> + <deprecated>No reason given</deprecated> + <required>false</required> + <editable>true</editable> + <description>(Deprecated, use reportsDirectories) This directory contains the XML Report files that will be parsed and rendered to HTML format.</description> + </parameter> + <parameter> + <name>showSuccess</name> + <type>boolean</type> + <required>true</required> + <editable>true</editable> + <description>If set to false, only failures are shown.</description> + </parameter> + <parameter> + <name>skipSurefireReport</name> + <type>boolean</type> + <since>2.11</since> + <required>false</required> + <editable>true</editable> + <description>If set to true the surefire report generation will be skipped.</description> + </parameter> + <parameter> + <name>xrefLocation</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>Location of the Xrefs to link.</description> + </parameter> + </parameters> + <configuration> + <aggregate implementation="boolean" default-value="false">${aggregate}</aggregate> + <alwaysGenerateSurefireReport implementation="boolean" default-value="true">${alwaysGenerateSurefireReport}</alwaysGenerateSurefireReport> + <customBundle implementation="java.lang.String" default-value="${basedir}/src/site/custom/surefire-report.properties"/> + <linkXRef implementation="boolean" default-value="true">${linkXRef}</linkXRef> + <outputName implementation="java.lang.String" default-value="surefire-report">${outputName}</outputName> + <showSuccess implementation="boolean" default-value="true">${showSuccess}</showSuccess> + <skipSurefireReport implementation="boolean" default-value="false">${skipSurefireReport}</skipSurefireReport> + <xrefLocation implementation="java.io.File" default-value="${project.reporting.outputDirectory}/xref-test"/> + </configuration> + </mojo> + </mojos> +</plugin> \ 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 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- Generated by maven-plugin-tools 3.9--> + +<plugin> + <name>${project.name}</name> + <description>${project.description}</description> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + <goalPrefix>surefire-report</goalPrefix> + <isolatedRealm>false</isolatedRealm> + <inheritedByDefault>true</inheritedByDefault> + <requiredJavaVersion>1.8</requiredJavaVersion> + <requiredMavenVersion>3.2.5</requiredMavenVersion> + <mojos> + <mojo> + <goal>failsafe-report-only</goal> + <description>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></description> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>true</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <implementation>org.apache.maven.plugins.surefire.report.FailsafeReportMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <since>2.10</since> + <threadSafe>false</threadSafe> + <parameters> + <parameter> + <name>aggregate</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Whether to build an aggregated report at the root, or build individual reports.</description> + </parameter> + <parameter> + <name>alwaysGenerateFailsafeReport</name> + <type>boolean</type> + <since>2.11</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>customBundle</name> + <type>java.lang.String</type> + <since>3.1.0</since> + <required>false</required> + <editable>true</editable> + <description>Path for a custom bundle instead of using the default one. +Using this field, you could change the texts in the generated reports.</description> + </parameter> + <parameter> + <name>inputEncoding</name> + <type>java.lang.String</type> + <required>false</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>linkXRef</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Whether to link the XRef if found.</description> + </parameter> + <parameter> + <name>localRepository</name> + <type>org.apache.maven.artifact.repository.ArtifactRepository</type> + <required>true</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>outputDirectory</name> + <type>java.io.File</type> + <required>true</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>outputEncoding</name> + <type>java.lang.String</type> + <required>false</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>outputName</name> + <type>java.lang.String</type> + <required>true</required> + <editable>true</editable> + <description>The filename to use for the report.</description> + </parameter> + <parameter> + <name>project</name> + <type>org.apache.maven.project.MavenProject</type> + <required>true</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>reactorProjects</name> + <type>java.util.List</type> + <required>false</required> + <editable>false</editable> + <description>The projects in the reactor for aggregation report.</description> + </parameter> + <parameter> + <name>remoteRepositories</name> + <type>java.util.List</type> + <required>true</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>reportsDirectories</name> + <type>java.io.File[]</type> + <required>false</required> + <editable>true</editable> + <description>Directories containing the XML Report files that will be parsed and rendered to HTML format.</description> + </parameter> + <parameter> + <name>reportsDirectory</name> + <type>java.io.File</type> + <deprecated>No reason given</deprecated> + <required>false</required> + <editable>true</editable> + <description>(Deprecated, use reportsDirectories) This directory contains the XML Report files that will be parsed and rendered to HTML format.</description> + </parameter> + <parameter> + <name>settings</name> + <type>org.apache.maven.settings.Settings</type> + <required>true</required> + <editable>false</editable> + <description>The current user system settings for use in Maven.</description> + </parameter> + <parameter> + <name>showSuccess</name> + <type>boolean</type> + <required>true</required> + <editable>true</editable> + <description>If set to false, only failures are shown.</description> + </parameter> + <parameter> + <name>skipFailsafeReport</name> + <type>boolean</type> + <since>2.11</since> + <required>false</required> + <editable>true</editable> + <description>If set to true the failsafe report generation will be skipped.</description> + </parameter> + <parameter> + <name>xrefLocation</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>Location of the Xrefs to link.</description> + </parameter> + </parameters> + <configuration> + <aggregate implementation="boolean" default-value="false">${aggregate}</aggregate> + <alwaysGenerateFailsafeReport implementation="boolean" default-value="false">${alwaysGenerateFailsafeReport}</alwaysGenerateFailsafeReport> + <customBundle implementation="java.lang.String" default-value="${basedir}/src/site/custom/surefire-report.properties"/> + <inputEncoding implementation="java.lang.String" default-value="${project.build.sourceEncoding}">${encoding}</inputEncoding> + <linkXRef implementation="boolean" default-value="true">${linkXRef}</linkXRef> + <localRepository implementation="org.apache.maven.artifact.repository.ArtifactRepository" default-value="${localRepository}"/> + <outputDirectory implementation="java.io.File" default-value="${project.reporting.outputDirectory}"/> + <outputEncoding implementation="java.lang.String" default-value="${project.reporting.outputEncoding}">${outputEncoding}</outputEncoding> + <outputName implementation="java.lang.String" default-value="failsafe-report">${outputName}</outputName> + <project implementation="org.apache.maven.project.MavenProject" default-value="${project}"/> + <reactorProjects implementation="java.util.List" default-value="${reactorProjects}"/> + <remoteRepositories implementation="java.util.List" default-value="${project.remoteArtifactRepositories}"/> + <settings implementation="org.apache.maven.settings.Settings" default-value="${settings}"/> + <showSuccess implementation="boolean" default-value="true">${showSuccess}</showSuccess> + <skipFailsafeReport implementation="boolean" default-value="false">${skipFailsafeReport}</skipFailsafeReport> + <xrefLocation implementation="java.io.File" default-value="${project.reporting.outputDirectory}/xref-test"/> + </configuration> + <requirements> + <requirement> + <role>org.codehaus.plexus.i18n.I18N</role> + <field-name>i18n</field-name> + </requirement> + <requirement> + <role>org.apache.maven.doxia.siterenderer.Renderer</role> + <field-name>siteRenderer</field-name> + </requirement> + <requirement> + <role>org.apache.maven.doxia.tools.SiteTool</role> + <field-name>siteTool</field-name> + </requirement> + </requirements> + </mojo> + <mojo> + <goal>help</goal> + <description>Display help information on maven-surefire-report-plugin. +Call mvn surefire-report:help -Ddetail=true -Dgoal=<goal-name> to display parameter details.</description> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>false</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <implementation>org.apache.maven.plugins.maven_surefire_report_plugin.HelpMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <threadSafe>true</threadSafe> + <parameters> + <parameter> + <name>detail</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>If true, display all settable properties for each goal.</description> + </parameter> + <parameter> + <name>goal</name> + <type>java.lang.String</type> + <required>false</required> + <editable>true</editable> + <description>The name of the goal for which to show help. If unspecified, all goals will be displayed.</description> + </parameter> + <parameter> + <name>indentSize</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>The number of spaces per indentation level, should be positive.</description> + </parameter> + <parameter> + <name>lineLength</name> + <type>int</type> + <required>false</required> + <editable>true</editable> + <description>The maximum length of a display line, should be positive.</description> + </parameter> + </parameters> + <configuration> + <detail implementation="boolean" default-value="false">${detail}</detail> + <goal implementation="java.lang.String">${goal}</goal> + <indentSize implementation="int" default-value="2">${indentSize}</indentSize> + <lineLength implementation="int" default-value="80">${lineLength}</lineLength> + </configuration> + </mojo> + <mojo> + <goal>report</goal> + <description>Creates a nicely formatted Surefire Test Report in html format.</description> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>true</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>false</inheritedByDefault> + <executePhase>test</executePhase> + <executeLifecycle>surefire</executeLifecycle> + <implementation>org.apache.maven.plugins.surefire.report.SurefireReportMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <threadSafe>false</threadSafe> + <parameters> + <parameter> + <name>aggregate</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Whether to build an aggregated report at the root, or build individual reports.</description> + </parameter> + <parameter> + <name>alwaysGenerateSurefireReport</name> + <type>boolean</type> + <since>2.11</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>customBundle</name> + <type>java.lang.String</type> + <since>3.1.0</since> + <required>false</required> + <editable>true</editable> + <description>Path for a custom bundle instead of using the default one. +Using this field, you could change the texts in the generated reports.</description> + </parameter> + <parameter> + <name>inputEncoding</name> + <type>java.lang.String</type> + <required>false</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>linkXRef</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Whether to link the XRef if found.</description> + </parameter> + <parameter> + <name>localRepository</name> + <type>org.apache.maven.artifact.repository.ArtifactRepository</type> + <required>true</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>outputDirectory</name> + <type>java.io.File</type> + <required>true</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>outputEncoding</name> + <type>java.lang.String</type> + <required>false</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>outputName</name> + <type>java.lang.String</type> + <required>true</required> + <editable>true</editable> + <description>The filename to use for the report.</description> + </parameter> + <parameter> + <name>project</name> + <type>org.apache.maven.project.MavenProject</type> + <required>true</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>reactorProjects</name> + <type>java.util.List</type> + <required>false</required> + <editable>false</editable> + <description>The projects in the reactor for aggregation report.</description> + </parameter> + <parameter> + <name>remoteRepositories</name> + <type>java.util.List</type> + <required>true</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>reportsDirectories</name> + <type>java.io.File[]</type> + <required>false</required> + <editable>true</editable> + <description>Directories containing the XML Report files that will be parsed and rendered to HTML format.</description> + </parameter> + <parameter> + <name>reportsDirectory</name> + <type>java.io.File</type> + <deprecated>No reason given</deprecated> + <required>false</required> + <editable>true</editable> + <description>(Deprecated, use reportsDirectories) This directory contains the XML Report files that will be parsed and rendered to HTML format.</description> + </parameter> + <parameter> + <name>settings</name> + <type>org.apache.maven.settings.Settings</type> + <required>true</required> + <editable>false</editable> + <description>The current user system settings for use in Maven.</description> + </parameter> + <parameter> + <name>showSuccess</name> + <type>boolean</type> + <required>true</required> + <editable>true</editable> + <description>If set to false, only failures are shown.</description> + </parameter> + <parameter> + <name>skipSurefireReport</name> + <type>boolean</type> + <since>2.11</since> + <required>false</required> + <editable>true</editable> + <description>If set to true the surefire report generation will be skipped.</description> + </parameter> + <parameter> + <name>xrefLocation</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>Location of the Xrefs to link.</description> + </parameter> + </parameters> + <configuration> + <aggregate implementation="boolean" default-value="false">${aggregate}</aggregate> + <alwaysGenerateSurefireReport implementation="boolean" default-value="true">${alwaysGenerateSurefireReport}</alwaysGenerateSurefireReport> + <customBundle implementation="java.lang.String" default-value="${basedir}/src/site/custom/surefire-report.properties"/> + <inputEncoding implementation="java.lang.String" default-value="${project.build.sourceEncoding}">${encoding}</inputEncoding> + <linkXRef implementation="boolean" default-value="true">${linkXRef}</linkXRef> + <localRepository implementation="org.apache.maven.artifact.repository.ArtifactRepository" default-value="${localRepository}"/> + <outputDirectory implementation="java.io.File" default-value="${project.reporting.outputDirectory}"/> + <outputEncoding implementation="java.lang.String" default-value="${project.reporting.outputEncoding}">${outputEncoding}</outputEncoding> + <outputName implementation="java.lang.String" default-value="surefire-report">${outputName}</outputName> + <project implementation="org.apache.maven.project.MavenProject" default-value="${project}"/> + <reactorProjects implementation="java.util.List" default-value="${reactorProjects}"/> + <remoteRepositories implementation="java.util.List" default-value="${project.remoteArtifactRepositories}"/> + <settings implementation="org.apache.maven.settings.Settings" default-value="${settings}"/> + <showSuccess implementation="boolean" default-value="true">${showSuccess}</showSuccess> + <skipSurefireReport implementation="boolean" default-value="false">${skipSurefireReport}</skipSurefireReport> + <xrefLocation implementation="java.io.File" default-value="${project.reporting.outputDirectory}/xref-test"/> + </configuration> + <requirements> + <requirement> + <role>org.codehaus.plexus.i18n.I18N</role> + <field-name>i18n</field-name> + </requirement> + <requirement> + <role>org.apache.maven.doxia.siterenderer.Renderer</role> + <field-name>siteRenderer</field-name> + </requirement> + <requirement> + <role>org.apache.maven.doxia.tools.SiteTool</role> + <field-name>siteTool</field-name> + </requirement> + </requirements> + </mojo> + <mojo> + <goal>report-only</goal> + <description>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></description> + <requiresDirectInvocation>false</requiresDirectInvocation> + <requiresProject>true</requiresProject> + <requiresReports>false</requiresReports> + <aggregator>false</aggregator> + <requiresOnline>false</requiresOnline> + <inheritedByDefault>true</inheritedByDefault> + <implementation>org.apache.maven.plugins.surefire.report.SurefireReportOnlyMojo</implementation> + <language>java</language> + <instantiationStrategy>per-lookup</instantiationStrategy> + <executionStrategy>once-per-session</executionStrategy> + <since>2.3</since> + <threadSafe>false</threadSafe> + <parameters> + <parameter> + <name>aggregate</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Whether to build an aggregated report at the root, or build individual reports.</description> + </parameter> + <parameter> + <name>alwaysGenerateSurefireReport</name> + <type>boolean</type> + <since>2.11</since> + <required>false</required> + <editable>true</editable> + <description>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.</description> + </parameter> + <parameter> + <name>customBundle</name> + <type>java.lang.String</type> + <since>3.1.0</since> + <required>false</required> + <editable>true</editable> + <description>Path for a custom bundle instead of using the default one. +Using this field, you could change the texts in the generated reports.</description> + </parameter> + <parameter> + <name>inputEncoding</name> + <type>java.lang.String</type> + <required>false</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>linkXRef</name> + <type>boolean</type> + <required>false</required> + <editable>true</editable> + <description>Whether to link the XRef if found.</description> + </parameter> + <parameter> + <name>localRepository</name> + <type>org.apache.maven.artifact.repository.ArtifactRepository</type> + <required>true</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>outputDirectory</name> + <type>java.io.File</type> + <required>true</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>outputEncoding</name> + <type>java.lang.String</type> + <required>false</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>outputName</name> + <type>java.lang.String</type> + <required>true</required> + <editable>true</editable> + <description>The filename to use for the report.</description> + </parameter> + <parameter> + <name>project</name> + <type>org.apache.maven.project.MavenProject</type> + <required>true</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>reactorProjects</name> + <type>java.util.List</type> + <required>false</required> + <editable>false</editable> + <description>The projects in the reactor for aggregation report.</description> + </parameter> + <parameter> + <name>remoteRepositories</name> + <type>java.util.List</type> + <required>true</required> + <editable>false</editable> + <description></description> + </parameter> + <parameter> + <name>reportsDirectories</name> + <type>java.io.File[]</type> + <required>false</required> + <editable>true</editable> + <description>Directories containing the XML Report files that will be parsed and rendered to HTML format.</description> + </parameter> + <parameter> + <name>reportsDirectory</name> + <type>java.io.File</type> + <deprecated>No reason given</deprecated> + <required>false</required> + <editable>true</editable> + <description>(Deprecated, use reportsDirectories) This directory contains the XML Report files that will be parsed and rendered to HTML format.</description> + </parameter> + <parameter> + <name>settings</name> + <type>org.apache.maven.settings.Settings</type> + <required>true</required> + <editable>false</editable> + <description>The current user system settings for use in Maven.</description> + </parameter> + <parameter> + <name>showSuccess</name> + <type>boolean</type> + <required>true</required> + <editable>true</editable> + <description>If set to false, only failures are shown.</description> + </parameter> + <parameter> + <name>skipSurefireReport</name> + <type>boolean</type> + <since>2.11</since> + <required>false</required> + <editable>true</editable> + <description>If set to true the surefire report generation will be skipped.</description> + </parameter> + <parameter> + <name>xrefLocation</name> + <type>java.io.File</type> + <required>false</required> + <editable>true</editable> + <description>Location of the Xrefs to link.</description> + </parameter> + </parameters> + <configuration> + <aggregate implementation="boolean" default-value="false">${aggregate}</aggregate> + <alwaysGenerateSurefireReport implementation="boolean" default-value="true">${alwaysGenerateSurefireReport}</alwaysGenerateSurefireReport> + <customBundle implementation="java.lang.String" default-value="${basedir}/src/site/custom/surefire-report.properties"/> + <inputEncoding implementation="java.lang.String" default-value="${project.build.sourceEncoding}">${encoding}</inputEncoding> + <linkXRef implementation="boolean" default-value="true">${linkXRef}</linkXRef> + <localRepository implementation="org.apache.maven.artifact.repository.ArtifactRepository" default-value="${localRepository}"/> + <outputDirectory implementation="java.io.File" default-value="${project.reporting.outputDirectory}"/> + <outputEncoding implementation="java.lang.String" default-value="${project.reporting.outputEncoding}">${outputEncoding}</outputEncoding> + <outputName implementation="java.lang.String" default-value="surefire-report">${outputName}</outputName> + <project implementation="org.apache.maven.project.MavenProject" default-value="${project}"/> + <reactorProjects implementation="java.util.List" default-value="${reactorProjects}"/> + <remoteRepositories implementation="java.util.List" default-value="${project.remoteArtifactRepositories}"/> + <settings implementation="org.apache.maven.settings.Settings" default-value="${settings}"/> + <showSuccess implementation="boolean" default-value="true">${showSuccess}</showSuccess> + <skipSurefireReport implementation="boolean" default-value="false">${skipSurefireReport}</skipSurefireReport> + <xrefLocation implementation="java.io.File" default-value="${project.reporting.outputDirectory}/xref-test"/> + </configuration> + <requirements> + <requirement> + <role>org.codehaus.plexus.i18n.I18N</role> + <field-name>i18n</field-name> + </requirement> + <requirement> + <role>org.apache.maven.doxia.siterenderer.Renderer</role> + <field-name>siteRenderer</field-name> + </requirement> + <requirement> + <role>org.apache.maven.doxia.tools.SiteTool</role> + <field-name>siteTool</field-name> + </requirement> + </requirements> + </mojo> + </mojos> + <dependencies> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-report-parser</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>org.apache.maven.surefire</groupId> + <artifactId>surefire-logger-api</artifactId> + <type>jar</type> + <version>3.2.5</version> + </dependency> + <dependency> + <groupId>org.apache.maven.shared</groupId> + <artifactId>maven-shared-utils</artifactId> + <type>jar</type> + <version>3.3.4</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <type>jar</type> + <version>2.15.1</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-classworlds</artifactId> + <type>jar</type> + <version>2.7.0</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-component-annotations</artifactId> + <type>jar</type> + <version>2.1.0</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <type>jar</type> + <version>3.14.0</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-interpolation</artifactId> + <type>jar</type> + <version>1.26</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-utils</artifactId> + <type>jar</type> + <version>4.0.0</version> + </dependency> + <dependency> + <groupId>org.apache.maven.doxia</groupId> + <artifactId>doxia-sink-api</artifactId> + <type>jar</type> + <version>1.12.0</version> + </dependency> + <dependency> + <groupId>org.apache.maven.doxia</groupId> + <artifactId>doxia-logging-api</artifactId> + <type>jar</type> + <version>1.12.0</version> + </dependency> + <dependency> + <groupId>org.apache.maven.doxia</groupId> + <artifactId>doxia-core</artifactId> + <type>jar</type> + <version>1.12.0</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-container-default</artifactId> + <type>jar</type> + <version>2.1.0</version> + </dependency> + <dependency> + <groupId>org.ow2.asm</groupId> + <artifactId>asm</artifactId> + <type>jar</type> + <version>5.0.3</version> + </dependency> + <dependency> + <groupId>org.ow2.asm</groupId> + <artifactId>asm-commons</artifactId> + <type>jar</type> + <version>5.0.3</version> + </dependency> + <dependency> + <groupId>org.ow2.asm</groupId> + <artifactId>asm-tree</artifactId> + <type>jar</type> + <version>9.6</version> + </dependency> + <dependency> + <groupId>org.apache.xbean</groupId> + <artifactId>xbean-reflect</artifactId> + <type>jar</type> + <version>3.7</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <type>jar</type> + <version>4.13.2</version> + </dependency> + <dependency> + <groupId>org.hamcrest</groupId> + <artifactId>hamcrest-core</artifactId> + <type>jar</type> + <version>1.3</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-text</artifactId> + <type>jar</type> + <version>1.3</version> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + <type>jar</type> + <version>4.5.13</version> + </dependency> + <dependency> + <groupId>commons-logging</groupId> + <artifactId>commons-logging</artifactId> + <type>jar</type> + <version>1.2</version> + </dependency> + <dependency> + <groupId>commons-codec</groupId> + <artifactId>commons-codec</artifactId> + <type>jar</type> + <version>1.11</version> + </dependency> + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpcore</artifactId> + <type>jar</type> + <version>4.4.14</version> + </dependency> + <dependency> + <groupId>org.apache.maven.reporting</groupId> + <artifactId>maven-reporting-api</artifactId> + <type>jar</type> + <version>3.1.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.reporting</groupId> + <artifactId>maven-reporting-impl</artifactId> + <type>jar</type> + <version>3.2.0</version> + </dependency> + <dependency> + <groupId>org.apache.maven.doxia</groupId> + <artifactId>doxia-site-renderer</artifactId> + <type>jar</type> + <version>1.11.1</version> + </dependency> + <dependency> + <groupId>commons-collections</groupId> + <artifactId>commons-collections</artifactId> + <type>jar</type> + <version>3.2.2</version> + </dependency> + <dependency> + <groupId>org.apache.maven.doxia</groupId> + <artifactId>doxia-skin-model</artifactId> + <type>jar</type> + <version>1.11.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.doxia</groupId> + <artifactId>doxia-module-xhtml5</artifactId> + <type>jar</type> + <version>1.11.1</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-i18n</artifactId> + <type>jar</type> + <version>1.0-beta-10</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-velocity</artifactId> + <type>jar</type> + <version>1.2</version> + </dependency> + <dependency> + <groupId>org.apache.maven.doxia</groupId> + <artifactId>doxia-module-xhtml</artifactId> + <type>jar</type> + <version>1.11.1</version> + </dependency> + <dependency> + <groupId>org.apache.velocity</groupId> + <artifactId>velocity</artifactId> + <type>jar</type> + <version>1.7</version> + </dependency> + <dependency> + <groupId>org.apache.maven.doxia</groupId> + <artifactId>doxia-decoration-model</artifactId> + <type>jar</type> + <version>1.11.1</version> + </dependency> + <dependency> + <groupId>org.apache.maven.doxia</groupId> + <artifactId>doxia-integration-tools</artifactId> + <type>jar</type> + <version>1.11.1</version> + </dependency> + <dependency> + <groupId>org.codehaus.plexus</groupId> + <artifactId>plexus-xml</artifactId> + <type>jar</type> + <version>4.0.0</version> + </dependency> + </dependencies> +</plugin> \ 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.<br> + * Call <code>mvn surefire-report:help -Ddetail=true -Dgoal=<goal-name></code> to display parameter details. + * @author maven-plugin-tools + */ +@Mojo( name = "help", requiresProject = false, threadSafe = true ) +public class HelpMojo + extends AbstractMojo +{ + /** + * If <code>true</code>, 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/<groupId>/<artifactId>/plugin-help.xml + private static final String PLUGIN_HELP_PATH = + "/META-INF/maven/org.apache.maven.plugins/maven-surefire-report-plugin/plugin-help.xml"; + + private static final int DEFAULT_LINE_LENGTH = 80; + + private Document build() + throws MojoExecutionException + { + getLog().debug( "load plugin-help.xml: " + PLUGIN_HELP_PATH ); + 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 ); + + //<goalPrefix>plugin</goalPrefix> + String goalPrefix = getValue( plugin, "goalPrefix" ); + + Node mojos1 = getSingleChild( plugin, "mojos" ); + + List<Node> 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<Node> 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<Node> findNamedChild( Node node, String elementName ) + { + List<Node> result = new ArrayList<Node>(); + 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<Node> 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<Node> 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 ); + } + + /** + * <p>Repeat a String <code>n</code> times to form a new string.</p> + * + * @param str String to repeat + * @param repeat number of times to repeat str + * @return String with repeated String + * @throws NegativeArraySizeException if <code>repeat < 0</code> + * @throws NullPointerException if str is <code>null</code> + */ + 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. + * <b>Note</b>: The last character is always a new line. + * + * @param sb The buffer to append the description, not <code>null</code>. + * @param description The description, not <code>null</code>. + * @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 <code>null</code>. + * @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 <code>null</code>. + * @throws NegativeArraySizeException if <code>indent < 0</code> + */ + private static List<String> toLines( String text, int indent, int indentSize, int lineLength ) + { + List<String> lines = new ArrayList<String>(); + + 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 <code>null</code>. + * @param line The line to add, must not be <code>null</code>. + * @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<String> 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 <code>null</code>. + * @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
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor