1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367
| mvn help:describe -Dplugin=org.apache.maven.plugins:maven-surefire-plugin:2.12.4 -Ddetail
[INFO] org.apache.maven.plugins:maven-surefire-plugin:2.12.4
Name: Maven Surefire Plugin Description: Surefire is a test framework project. Group Id: org.apache.maven.plugins Artifact Id: maven-surefire-plugin Version: 2.12.4 Goal Prefix: surefire
This plugin has 2 goals:
surefire:help Description: Display help information on maven-surefire-plugin. Call mvn surefire:help -Ddetail=true -Dgoal=<goal-name> to display parameter details. Implementation: org.apache.maven.plugin.surefire.HelpMojo Language: java
Available parameters:
detail (Default: false) User property: detail If true, display all settable properties for each goal.
goal User property: goal The name of the goal for which to show help. If unspecified, all goals will be displayed.
indentSize (Default: 2) User property: indentSize The number of spaces per indentation level, should be positive.
lineLength (Default: 80) User property: lineLength The maximum length of a display line, should be positive.
surefire:test Description: Run tests using Surefire. Implementation: org.apache.maven.plugin.surefire.SurefirePlugin Language: java Bound to phase: test #默认绑定到test生命周期
Available parameters:
additionalClasspathElements Additional elements to be appended to the classpath.
argLine User property: argLine Arbitrary JVM options to set on the command line.
basedir (Default: ${basedir}) The base directory of the project being tested. This can be obtained in your integration test via System.getProperty('basedir').
childDelegation (Default: false) User property: childDelegation When false it makes tests run using the standard classloader delegation instead of the default Maven isolated classloader. Only used when forking (forkMode is not 'none'). Setting it to false helps with some problems caused by conflicts between xml parsers in the classpath and the Java 5 provider parser.
classesDirectory (Default: ${project.build.outputDirectory}) The directory containing generated classes of the project being tested. This will be included after the test classes in the test classpath.
classpathDependencyExcludes List of dependencies to exclude from the test classpath. Each dependency string must follow the format groupId:artifactId. For example: org.acme:project-a
classpathDependencyScopeExclude A dependency scope to exclude from the test classpath. 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
debugForkedProcess User property: maven.surefire.debug 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).
disableXmlReport (Default: false) User property: disableXmlReport Flag to disable the generation of report files in xml format.
enableAssertions (Default: true) User property: enableAssertions By default, Surefire enables JVM assertions for the execution of your test cases. To disable the assertions, set this flag to 'false'.
environmentVariables Additional environment variables to set on the command line.
excludedGroups User property: excludedGroups (TestNG/JUnit47 provider with JUnit4.8+ only) Excluded groups. Any methods/classes/etc with one of the groups specified in this list will specifically not be run. For JUnit, this parameter forces the use of the 4.7 provider This parameter is ignored if the suiteXmlFiles parameter is specified.
excludes 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 sublist of items, which will be treated as multiple <exclude> entries.
failIfNoSpecifiedTests User property: surefire.failIfNoSpecifiedTests Set this to 'true' to cause a failure if the none of the tests specified in -Dtest=... are run. Defaults to 'true'.
failIfNoTests User property: failIfNoTests Set this to 'true' to cause a failure if there are no tests to run. Defaults to 'false'.
forkedProcessTimeoutInSeconds User property: surefire.timeout Kill the forked test process after a certain number of seconds. If set to 0, wait forever for the process, never timing out.
forkMode (Default: once) User property: forkMode Option to specify the forking mode. Can be 'never', 'once', 'always' or 'perthread'. 'none' and 'pertest' are also accepted for backwards compatibility. 'always' forks for each test-class. 'perthread' will create 'threadCount' parallel forks.
groups User property: groups (TestNG/JUnit47 provider with JUnit4.8+ only) Groups for this test. Only classes/methods/etc decorated with one of the groups specified here will be included in test run, if specified. For JUnit, this parameter forces the use of the 4.7 provider This parameter is ignored if the suiteXmlFiles parameter is specified.
includes 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>**/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. This parameter is ignored if the TestNG suiteXmlFiles parameter is specified.
junitArtifactName (Default: junit:junit) User property: junitArtifactName Allows you to specify the name of the JUnit artifact. If not set, junit:junit will be used.
jvm User property: jvm Option to specify the jvm (or path to the java executable) to use with the forking options. For the default, the jvm will be a new instance of the same VM as the one used to run Maven. JVM settings are not inherited from MAVEN_OPTS.
objectFactory User property: objectFactory (TestNG only) Define the factory class used to create all test instances.
parallel User property: parallel (TestNG only) When you use the parallel attribute, 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. (JUnit 4.7 provider) Supports values 'classes'/'methods'/'both' to run in separate threads, as controlled by threadCount.
perCoreThreadCount (Default: true) User property: perCoreThreadCount (JUnit 4.7 provider) Indicates that threadCount is per cpu core.
printSummary (Default: true) User property: surefire.printSummary Option to print summary of test suites or just print the test cases that have errors.
properties List of properties for configuring all TestNG related configurations. This is the new preferred method of configuring TestNG.
redirectTestOutputToFile (Default: false) User property: maven.test.redirectTestOutputToFile Set this to 'true' to redirect the unit test standard output to a file (found in reportsDirectory/testName-output.txt).
remoteRepositories (Default: ${project.pluginArtifactRepositories}) The remote plugin repositories declared in the POM.
reportFormat (Default: brief) User property: surefire.reportFormat Selects the formatting for the test report to be generated. Can be set as 'brief' or 'plain'.
reportNameSuffix User property: surefire.reportNameSuffix Add custom text into report filename: TEST-testClassName-reportNameSuffix.xml, testClassName-reportNameSuffix.txt and testClassName-reportNameSuffix-output.txt. File TEST-testClassName-reportNameSuffix.xml has changed attributes 'testsuite'--'name' and 'testcase'--'classname' - reportNameSuffix is added to the attribute value.
reportsDirectory (Default: ${project.build.directory}/surefire-reports) Base directory where all reports are written to.
runOrder (Default: filesystem) 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 to make all tests complete at the same time, reducing the overall execution time. 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 config settings you will re-run once before new statistics data can be established.
skip (Default: false) User property: maven.test.skip 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.
skipExec User property: maven.test.skip.exec This old parameter is just like skipTests, but bound to the old property 'maven.test.skip.exec'. Deprecated. Use skipTests instead.
skipTests (Default: false) User property: skipTests Set this to 'true' to skip running tests, but still compile them. Its use is NOT RECOMMENDED, but quite convenient on occasion.
suiteXmlFiles (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/excludes. This parameter is ignored if the test parameter is specified (allowing you to run a single test instead of an entire suite).
systemProperties List of System properties to pass to the JUnit tests. Deprecated. Use systemPropertyVariables instead.
systemPropertiesFile List of System properties, loaded from a file, to pass to the JUnit tests.
systemPropertyVariables List of System properties to pass to the JUnit tests.
test User property: test Specify this parameter to run individual tests by file name, overriding the includes/excludes parameters. 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'. This parameter overrides the includes/excludes parameters, and the TestNG suiteXmlFiles parameter. 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.
testClassesDirectory (Default: ${project.build.testOutputDirectory}) The directory containing generated test classes of the project being tested. This will be included at the beginning of the test classpath. *
testFailureIgnore (Default: false) User property: maven.test.failure.ignore Set this to 'true' to ignore a failure during testing. Its use is NOT RECOMMENDED, but quite convenient on occasion.
testNGArtifactName (Default: org.testng:testng) User property: testNGArtifactName Allows you to specify the name of the TestNG artifact. If not set, org.testng:testng will be used.
testSourceDirectory (Default: ${project.build.testSourceDirectory}) Required: true The test source directory containing test class sources.
threadCount User property: threadCount (forkMode=perthread or 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. (forkMode=perthread does not support/require the parallel parameter)
trimStackTrace (Default: true) User property: trimStackTrace Whether to trim the stack trace in the reports to just the lines within the test, or show the full trace.
useFile (Default: true) User property: surefire.useFile Option to generate a file test report or just output the test report to the console.
useManifestOnlyJar (Default: true) User property: surefire.useManifestOnlyJar 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 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.
useSystemClassLoader (Default: true) User property: surefire.useSystemClassLoader Option to pass dependencies to the system's classloader instead of using an isolated class loader when forking. Prevents problems with JDKs which implement the service provider lookup mechanism by using the system's classloader.
useUnlimitedThreads (Default: false) User property: useUnlimitedThreads (JUnit 4.7 provider) Indicates that the thread pool will be unlimited. The parallel parameter and the actual number of classes/methods will decide. Setting this to 'true' effectively disables perCoreThreadCount and threadCount. Defaults to 'false'.
workingDirectory User property: basedir Command line working directory.
|
v1.3.10