You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+93-12Lines changed: 93 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@
24
24
importjava.io.IOException;
25
25
importjava.math.BigDecimal;
26
26
importjava.nio.file.Files;
27
+
importjava.text.ChoiceFormat;
27
28
importjava.util.ArrayList;
28
29
importjava.util.Arrays;
29
30
importjava.util.Collection;
@@ -319,25 +320,49 @@ public abstract class AbstractSurefireMojo extends AbstractMojo implements Suref
319
320
*/
320
321
@Deprecated
321
322
@Parameter
322
-
privatePropertiessystemProperties;
323
+
PropertiessystemProperties;
323
324
324
325
/**
325
326
* List of System properties to pass to a provider.
326
327
* The effective system properties given to a provider are contributed from several sources:
327
328
* <ol>
329
+
* <li>properties set via {@link #argLine} with {@code -D} (only for forked executions)</li>
328
330
* <li>{@link #systemProperties}</li>
329
331
* <li>{@link AbstractSurefireMojo#getSystemPropertiesFile()} (set via parameter {@code systemPropertiesFile} on some goals)</li>
330
332
* <li>{@link #systemPropertyVariables}</li>
331
-
* <li>User properties from {@link MavenSession#getUserProperties()}, usually set via CLI options given with {@code -D}</li>
333
+
* <li>User properties from {@link MavenSession#getUserProperties()}, usually set via CLI options given with {@code -D} on the current Maven process</li>
334
+
* <li>{@link #userPropertyVariables}</li>
332
335
* </ol>
333
336
* Later sources may overwrite same named properties from earlier sources, that means for example that one cannot overwrite user properties with either
334
-
* {@link #systemProperties}, {@link AbstractSurefireMojo#getSystemPropertiesFile()} or {@link #systemPropertyVariables}.
337
+
* {@link #systemProperties}, {@link #getSystemPropertiesFile()} or {@link #systemPropertyVariables} but only with
338
+
* {@link #userPropertyVariables}.
339
+
* <p>
340
+
* Certain properties may only be overwritten via {@link #argLine} (applicable only for forked executions) because their values are cached and only evaluated at the start of the JRE.
* Similar to {@link #systemPropertyVariables} but having a higher precedence, therefore allows to overwrite user properties from the current Maven session.
358
+
* This should only be used in case a user property from the parent process needs to be explicitly overwritten.
359
+
* Regular properties should be set via {@link #systemPropertyVariables} instead in order to allow them to be overwritten
360
+
* via CLI arguments ({@code -Dmyproperty=myvalue})
361
+
* @since 3.4
362
+
* @see #systemPropertyVariables
363
+
*/
364
+
@Parameter
365
+
Map<String, String> userPropertyVariables;
341
366
342
367
/**
343
368
* List of properties for configuring the testing provider. This is the preferred method of
@@ -425,7 +450,7 @@ public abstract class AbstractSurefireMojo extends AbstractMojo implements Suref
425
450
privateStringjvm;
426
451
427
452
/**
428
-
* Arbitrary JVM options to set on the command line.
453
+
* Arbitrary JVM options to set on the command line. Only effective for forked executions.
429
454
* <br>
430
455
* <br>
431
456
* Since the Version 2.17 using an alternate syntax for {@code argLine}, <b>@{...}</b> allows late replacement
@@ -438,6 +463,7 @@ public abstract class AbstractSurefireMojo extends AbstractMojo implements Suref
0 commit comments