Skip to content

Commit cd72eaa

Browse files
committed
javadoc: improve description of systemPropertyVariables and
systemPropertiesFile clarify order of precedence
1 parent 43f0980 commit cd72eaa

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

maven-failsafe-plugin/src/main/java/org/apache/maven/plugin/failsafe/IntegrationTestMojo.java

+5
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,11 @@ public class IntegrationTestMojo extends AbstractSurefireMojo {
525525
@Parameter(property = "failsafe.enableProcessChecker")
526526
private String enableProcessChecker;
527527

528+
/**
529+
* Properties file being used as system properties passed to the provider.
530+
*
531+
* @see AbstractSurefireMojo#systemPropertyVariables {@code systemPropertyVariables} for how the effective provider properties are calculated
532+
*/
528533
@Parameter(property = "failsafe.systemPropertiesFile")
529534
private File systemPropertiesFile;
530535

maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java

+12-1
Original file line numberDiff line numberDiff line change
@@ -314,16 +314,27 @@ public abstract class AbstractSurefireMojo extends AbstractMojo implements Suref
314314
/**
315315
* List of System properties to pass to a provider.
316316
*
317-
* @deprecated Use systemPropertyVariables instead.
317+
* @deprecated Use {@link #systemPropertyVariables} instead.
318+
* @see #systemPropertyVariables {@code systemPropertyVariables} for how the effective provider properties are calculated
318319
*/
319320
@Deprecated
320321
@Parameter
321322
private Properties systemProperties;
322323

323324
/**
324325
* List of System properties to pass to a provider.
326+
* The effective system properties given to a provider are contributed from several sources:
327+
* <ol>
328+
* <li>{@link #systemProperties}</li>
329+
* <li>{@link AbstractSurefireMojo#getSystemPropertiesFile()} (set via parameter {@code systemPropertiesFile} on some goals)</li>
330+
* <li>{@link #systemPropertyVariables}</li>
331+
* <li>User properties from {@link MavenSession#getUserProperties()}, usually set via CLI options given with {@code -D}</li>
332+
* </ol>
333+
* 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}.
325335
*
326336
* @since 2.5
337+
* @see #systemProperties
327338
*/
328339
@Parameter
329340
private Map<String, String> systemPropertyVariables;

maven-surefire-plugin/src/main/java/org/apache/maven/plugin/surefire/SurefirePlugin.java

+5
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,11 @@ public class SurefirePlugin extends AbstractSurefireMojo implements SurefireRepo
502502
@Parameter(property = "surefire.enableProcessChecker")
503503
private String enableProcessChecker;
504504

505+
/**
506+
* Properties file being used as system properties passed to the provider.
507+
*
508+
* @see AbstractSurefireMojo#systemPropertyVariables {@code systemPropertyVariables} for how the effective provider properties are calculated
509+
*/
505510
@Parameter(property = "surefire.systemPropertiesFile")
506511
private File systemPropertiesFile;
507512

0 commit comments

Comments
 (0)