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
[SUREFIRE-1385] Add new parameter "promoteUserPropertiesToSystemProperties" (#762)
This allows to disable merging of user properties into effective system properties
Log overwritten properties
Clarify effective properties merging order
Copy file name to clipboardExpand all lines: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+83-12
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,45 @@ 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 (only used as source if {@link #promoteUserPropertiesToSystemProperties} is {@code true})</li>
332
334
* </ol>
333
335
* 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}.
336
+
* {@link #systemProperties}, {@link #getSystemPropertiesFile()} or {@link #systemPropertyVariables}.
337
+
* <p>
338
+
* 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.
0 commit comments