This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-surefire.git


The following commit(s) were added to refs/heads/master by this push:
     new 4bd36a12a [SUREFIRE-1385] Add new parameter 
"promoteUserPropertiesToSystemProperties" (#762)
4bd36a12a is described below

commit 4bd36a12a9cf7e848e2e2d9d36032f0db66cfe74
Author: Konrad Windszus <[email protected]>
AuthorDate: Wed Aug 7 19:11:34 2024 +0200

    [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
---
 maven-failsafe-plugin/pom.xml                      |  2 +-
 maven-surefire-common/pom.xml                      |  2 +-
 .../plugin/surefire/AbstractSurefireMojo.java      | 95 +++++++++++++++++++---
 .../maven/plugin/surefire/SurefireProperties.java  | 64 ++++++++-------
 .../plugin/surefire/AbstractSurefireMojoTest.java  | 85 +++++++++++++++++++
 .../plugin/surefire/SurefirePropertiesTest.java    | 14 ++++
 maven-surefire-plugin/pom.xml                      |  2 +-
 .../src/site/apt/examples/system-properties.apt.vm | 34 ++++++--
 maven-surefire-report-plugin/pom.xml               |  2 +-
 pom.xml                                            |  4 +-
 surefire-api/pom.xml                               |  2 +-
 surefire-booter/pom.xml                            |  2 +-
 surefire-extensions-api/pom.xml                    |  2 +-
 surefire-extensions-spi/pom.xml                    |  2 +-
 surefire-grouper/pom.xml                           |  2 +-
 surefire-its/pom.xml                               |  2 +-
 surefire-logger-api/pom.xml                        |  2 +-
 surefire-providers/common-java5/pom.xml            |  2 +-
 surefire-providers/common-junit3/pom.xml           |  2 +-
 surefire-providers/common-junit4/pom.xml           |  2 +-
 surefire-providers/common-junit48/pom.xml          |  2 +-
 surefire-providers/pom.xml                         |  2 +-
 surefire-providers/surefire-junit-platform/pom.xml |  2 +-
 surefire-providers/surefire-junit3/pom.xml         |  2 +-
 surefire-providers/surefire-junit4/pom.xml         |  2 +-
 surefire-providers/surefire-junit47/pom.xml        |  2 +-
 surefire-providers/surefire-testng-utils/pom.xml   |  2 +-
 surefire-providers/surefire-testng/pom.xml         |  2 +-
 surefire-report-parser/pom.xml                     |  2 +-
 surefire-shadefire/pom.xml                         |  2 +-
 surefire-shared-utils/pom.xml                      |  2 +-
 31 files changed, 274 insertions(+), 72 deletions(-)

diff --git a/maven-failsafe-plugin/pom.xml b/maven-failsafe-plugin/pom.xml
index 3a464997d..e83d8d9cf 100644
--- a/maven-failsafe-plugin/pom.xml
+++ b/maven-failsafe-plugin/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <groupId>org.apache.maven.plugins</groupId>
diff --git a/maven-surefire-common/pom.xml b/maven-surefire-common/pom.xml
index de13d9831..bba8dfddc 100644
--- a/maven-surefire-common/pom.xml
+++ b/maven-surefire-common/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>maven-surefire-common</artifactId>
diff --git 
a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
 
b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
index 47d691a13..094843123 100644
--- 
a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
+++ 
b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
@@ -24,6 +24,7 @@ import java.io.File;
 import java.io.IOException;
 import java.math.BigDecimal;
 import java.nio.file.Files;
+import java.text.ChoiceFormat;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -319,25 +320,45 @@ public abstract class AbstractSurefireMojo extends 
AbstractMojo implements Suref
      */
     @Deprecated
     @Parameter
-    private Properties systemProperties;
+    Properties systemProperties;
 
     /**
      * List of System properties to pass to a provider.
      * The effective system properties given to a provider are contributed 
from several sources:
      * <ol>
+     * <li>properties set via {@link #argLine} with {@code -D} (only for 
forked executions)</li>
      * <li>{@link #systemProperties}</li>
      * <li>{@link AbstractSurefireMojo#getSystemPropertiesFile()} (set via 
parameter {@code systemPropertiesFile} on some goals)</li>
      * <li>{@link #systemPropertyVariables}</li>
-     * <li>User properties from {@link MavenSession#getUserProperties()}, 
usually set via CLI options given with {@code -D}</li>
+     * <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>
      * </ol>
      * Later sources may overwrite same named properties from earlier sources, 
that means for example that one cannot overwrite user properties with either
-     * {@link #systemProperties}, {@link 
AbstractSurefireMojo#getSystemPropertiesFile()} or {@link 
#systemPropertyVariables}.
+     * {@link #systemProperties}, {@link #getSystemPropertiesFile()} or {@link 
#systemPropertyVariables}.
+     * <p>
+     * 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.
+     * Those include:
+     * <ul>
+     * <li>{@code java.library.path}</li>
+     * <li>{@code file.encoding}</li>
+     * <li>{@code jdk.map.althashing.threshold}</li>
+     * <li>{@code line.separator}</li>
+     * </ul>
      *
      * @since 2.5
      * @see #systemProperties
      */
     @Parameter
-    private Map<String, String> systemPropertyVariables;
+    Map<String, String> systemPropertyVariables;
+
+    /**
+     * If set to {@code true} will also pass all user properties exposed via 
{@link MavenSession#getUserProperties()} as system properties to a provider.
+     * Those always take precedence over same named system properties set via 
any other means.
+     *
+     * @since 3.4.0
+     * @see #systemPropertyVariables
+     */
+    @Parameter(defaultValue = "true")
+    boolean promoteUserPropertiesToSystemProperties;
 
     /**
      * List of properties for configuring the testing provider. This is the 
preferred method of
@@ -425,7 +446,7 @@ public abstract class AbstractSurefireMojo extends 
AbstractMojo implements Suref
     private String jvm;
 
     /**
-     * Arbitrary JVM options to set on the command line.
+     * Arbitrary JVM options to set on the command line. Only effective for 
forked executions.
      * <br>
      * <br>
      * Since the Version 2.17 using an alternate syntax for {@code argLine}, 
<b>@{...}</b> allows late replacement
@@ -438,6 +459,7 @@ public abstract class AbstractSurefireMojo extends 
AbstractMojo implements Suref
      * <a 
href="http://maven.apache.org/surefire/maven-failsafe-plugin/faq.html";>
      *     http://maven.apache.org/surefire/maven-failsafe-plugin/faq.html</a>
      *
+     * @see #forkCount
      * @since 2.1
      */
     @Parameter(property = "argLine")
@@ -543,7 +565,7 @@ public abstract class AbstractSurefireMojo extends 
AbstractMojo implements Suref
      * @since 2.14
      */
     @Parameter(property = "forkCount", defaultValue = "1")
-    private String forkCount;
+    String forkCount;
 
     /**
      * Indicates if forked VMs can be reused. If set to "false", a new VM is 
forked for each test class to be executed.
@@ -1139,10 +1161,10 @@ public abstract class AbstractSurefireMojo extends 
AbstractMojo implements Suref
                 new JUnit3ProviderInfo());
     }
 
-    private SurefireProperties setupProperties() {
-        SurefireProperties sysProps = null;
+    SurefireProperties setupProperties() {
+        SurefireProperties sysPropsFromFile = null;
         try {
-            sysProps = 
SurefireProperties.loadProperties(getSystemPropertiesFile());
+            sysPropsFromFile = 
SurefireProperties.loadProperties(getSystemPropertiesFile());
         } catch (IOException e) {
             String msg = "The file '" + 
getSystemPropertiesFile().getAbsolutePath() + "' can't be read.";
             if (getConsoleLogger().isDebugEnabled()) {
@@ -1152,8 +1174,11 @@ public abstract class AbstractSurefireMojo extends 
AbstractMojo implements Suref
             }
         }
 
-        SurefireProperties result = 
SurefireProperties.calculateEffectiveProperties(
-                getSystemProperties(), getSystemPropertyVariables(), 
getUserProperties(), sysProps);
+        SurefireProperties result = calculateEffectiveProperties(
+                getSystemProperties(),
+                getSystemPropertyVariables(),
+                promoteUserPropertiesToSystemProperties ? getUserProperties() 
: new Properties(),
+                sysPropsFromFile);
 
         result.setProperty("basedir", getBasedir().getAbsolutePath());
         result.setProperty("localRepository", getLocalRepositoryPath());
@@ -1184,6 +1209,38 @@ public abstract class AbstractSurefireMojo extends 
AbstractMojo implements Suref
         return result;
     }
 
+    private SurefireProperties calculateEffectiveProperties(
+            Properties systemProperties,
+            Map<String, String> systemPropertyVariables,
+            Properties userProperties,
+            SurefireProperties sysPropsFromFile) {
+        SurefireProperties result = new SurefireProperties();
+        result.copyPropertiesFrom(systemProperties);
+
+        Collection<String> overwrittenProperties = 
result.copyPropertiesFrom(sysPropsFromFile);
+        if (!overwrittenProperties.isEmpty() && 
getConsoleLogger().isDebugEnabled()) {
+            
getConsoleLogger().debug(getOverwrittenPropertiesLogMessage(overwrittenProperties,
 "systemPropertiesFile"));
+        }
+        overwrittenProperties = 
result.copyPropertiesFrom(systemPropertyVariables);
+        if (!overwrittenProperties.isEmpty() && 
getConsoleLogger().isDebugEnabled()) {
+            getConsoleLogger()
+                    
.debug(getOverwrittenPropertiesLogMessage(overwrittenProperties, 
"systemPropertyVariables"));
+        }
+        // We used to take all of our system properties and dump them in with 
the
+        // user specified properties for SUREFIRE-121, causing SUREFIRE-491.
+        // Not gonna do THAT any more... instead, we only propagate those 
system properties
+        // that have been explicitly specified by the user via -Dkey=value on 
the CLI
+        if (!userProperties.isEmpty()) {
+            overwrittenProperties = result.copyPropertiesFrom(userProperties);
+            if (!overwrittenProperties.isEmpty()) {
+                getConsoleLogger()
+                        .warning(getOverwrittenPropertiesLogMessage(
+                                overwrittenProperties, "user properties from 
Maven session"));
+            }
+        }
+        return result;
+    }
+
     private Set<Object> systemPropertiesMatchingArgLine(SurefireProperties 
result) {
         Set<Object> intersection = new HashSet<>();
         if (isNotBlank(getArgLine())) {
@@ -1199,6 +1256,20 @@ public abstract class AbstractSurefireMojo extends 
AbstractMojo implements Suref
         return intersection;
     }
 
+    private String getOverwrittenPropertiesLogMessage(
+            Collection<String> overwrittenProperties, String 
overwrittenBySource) {
+        if (overwrittenProperties.isEmpty()) {
+            throw new IllegalArgumentException("overwrittenProperties must not 
be empty");
+        }
+        // one or multiple?
+        ChoiceFormat propertyChoice = new 
ChoiceFormat("1#property|1>properties");
+        StringBuilder message = new StringBuilder("System ");
+        
message.append(propertyChoice.format(overwrittenProperties.size())).append(" ");
+        
message.append(overwrittenProperties.stream().collect(Collectors.joining("], 
[", "[", "]")));
+        message.append(" overwritten by ").append(overwrittenBySource);
+        return message.toString();
+    }
+
     private void showToLog(SurefireProperties props, ConsoleLogger log) {
         for (Object key : props.getStringKeySet()) {
             String value = props.getProperty((String) key);
@@ -2718,7 +2789,7 @@ public abstract class AbstractSurefireMojo extends 
AbstractMojo implements Suref
         return existing;
     }
 
-    private Properties getUserProperties() {
+    Properties getUserProperties() {
         return getSession().getUserProperties();
     }
 
diff --git 
a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireProperties.java
 
b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireProperties.java
index 96e3cdaef..6aeef18f0 100644
--- 
a/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireProperties.java
+++ 
b/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/SurefireProperties.java
@@ -27,6 +27,7 @@ import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashSet;
 import java.util.LinkedHashSet;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
@@ -40,7 +41,7 @@ import static java.util.Arrays.asList;
 import static java.util.Map.Entry;
 
 /**
- * A properties implementation that preserves insertion order.
+ * A {@link Properties} implementation that preserves insertion order.
  */
 public class SurefireProperties extends Properties implements KeyValueSource {
     private static final Collection<String> 
KEYS_THAT_CANNOT_BE_USED_AS_SYSTEM_PROPERTIES =
@@ -64,9 +65,17 @@ public class SurefireProperties extends Properties 
implements KeyValueSource {
 
     @Override
     public synchronized void putAll(Map<?, ?> t) {
-        for (Entry<?, ?> entry : t.entrySet()) {
-            put(entry.getKey(), entry.getValue());
+        putAllInternal(t);
+    }
+
+    private Collection<String> putAllInternal(Map<?, ?> source) {
+        Collection<String> overwrittenProperties = new LinkedList<>();
+        for (Entry<?, ?> entry : source.entrySet()) {
+            if (put(entry.getKey(), entry.getValue()) != null) {
+                overwrittenProperties.add(entry.getKey().toString());
+            }
         }
+        return overwrittenProperties;
     }
 
     @Override
@@ -92,12 +101,28 @@ public class SurefireProperties extends Properties 
implements KeyValueSource {
         return Collections.enumeration(items);
     }
 
-    public void copyPropertiesFrom(Properties source) {
+    /**
+     * Copies all keys and values from source to these properties, overwriting 
existing properties with same name
+     * @param source
+     * @return all overwritten property names (may be empty if there was no 
property name clash)
+     */
+    public Collection<String> copyPropertiesFrom(Properties source) {
         if (source != null) {
-            putAll(source);
+            return putAllInternal(source);
+        } else {
+            return Collections.emptyList();
         }
     }
 
+    /**
+     * Copies all keys and values from source to these properties, overwriting 
existing properties with same name
+     * @param source
+     * @return all overwritten property names (may be empty if there was no 
property name clash)
+     */
+    public Collection<String> copyPropertiesFrom(Map<String, String> source) {
+        return copyProperties(this, source);
+    }
+
     public Iterable<Object> getStringKeySet() {
         return keySet();
     }
@@ -121,34 +146,17 @@ public class SurefireProperties extends Properties 
implements KeyValueSource {
         }
     }
 
-    static SurefireProperties calculateEffectiveProperties(
-            Properties systemProperties,
-            Map<String, String> systemPropertyVariables,
-            Properties userProperties,
-            SurefireProperties props) {
-        SurefireProperties result = new SurefireProperties();
-        result.copyPropertiesFrom(systemProperties);
-
-        result.copyPropertiesFrom(props);
-
-        copyProperties(result, systemPropertyVariables);
-
-        // We used to take all of our system properties and dump them in with 
the
-        // user specified properties for SUREFIRE-121, causing SUREFIRE-491.
-        // Not gonna do THAT any more... instead, we only propagate those 
system properties
-        // that have been explicitly specified by the user via -Dkey=value on 
the CLI
-
-        result.copyPropertiesFrom(userProperties);
-        return result;
-    }
-
-    private static void copyProperties(Properties target, Map<String, String> 
source) {
+    private static Collection<String> copyProperties(Properties target, 
Map<String, String> source) {
+        Collection<String> overwrittenProperties = new LinkedList<>();
         if (source != null) {
             for (String key : source.keySet()) {
                 String value = source.get(key);
-                target.setProperty(key, value == null ? "" : value);
+                if (target.setProperty(key, value == null ? "" : value) != 
null) {
+                    overwrittenProperties.add(key);
+                }
             }
         }
+        return overwrittenProperties;
     }
 
     @Override
diff --git 
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
 
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
index dee5e3926..1af67c838 100644
--- 
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
+++ 
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/AbstractSurefireMojoTest.java
@@ -19,7 +19,10 @@
 package org.apache.maven.plugin.surefire;
 
 import java.io.File;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.OutputStream;
+import java.io.UncheckedIOException;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.ArrayList;
@@ -60,6 +63,7 @@ import org.apache.maven.surefire.booter.StartupConfiguration;
 import org.apache.maven.surefire.extensions.ForkNodeFactory;
 import org.apache.maven.surefire.providerapi.ProviderInfo;
 import org.apache.maven.toolchain.Toolchain;
+import org.assertj.core.api.Assertions;
 import org.codehaus.plexus.languages.java.jpms.JavaModuleDescriptor;
 import org.codehaus.plexus.languages.java.jpms.LocationManager;
 import org.codehaus.plexus.languages.java.jpms.ResolvePathRequest;
@@ -2460,6 +2464,87 @@ public class AbstractSurefireMojoTest {
         assertThat(result.getClasses()).isEmpty();
     }
 
+    @Test
+    public void testSetupProperties() {
+        Mojo plugin = new Mojo() {
+
+            @Override
+            Properties getUserProperties() {
+                Properties properties = new Properties();
+                properties.put("userProperties1", "source4");
+                return properties;
+            }
+
+            @Override
+            public File getBasedir() {
+                return new File("target");
+            }
+
+            @Override
+            public String getLocalRepositoryPath() {
+                return "local/repository/path";
+            }
+
+            @Override
+            public File getSystemPropertiesFile() {
+                Properties systemProperties = new Properties();
+                systemProperties.put("systemProperties2", "source2");
+                systemProperties.put("systemProperties3", "source2");
+                systemProperties.put("userProperties1", "source2");
+                try {
+                    File propertiesFile = tempFolder.newFile();
+                    try (OutputStream outputStream = new 
FileOutputStream(propertiesFile)) {
+                        systemProperties.store(outputStream, "comments");
+                    }
+                    return propertiesFile;
+                } catch (IOException e) {
+                    throw new UncheckedIOException(e);
+                }
+            }
+        };
+
+        plugin.setLogger(mock(Logger.class));
+        /* expected order of precedence:
+         * 1. systemProperties
+         * 2. getSystemPropertiesFile()
+         * 3. systemPropertyVariables
+         * 4. getUserProperties()
+         */
+        plugin.forkCount = "1";
+        plugin.promoteUserPropertiesToSystemProperties = true;
+        Properties systemProperties = new Properties();
+        systemProperties.put("systemProperties1", "source1");
+        systemProperties.put("systemProperties2", "source1");
+        systemProperties.put("systemProperties3", "source1");
+        systemProperties.put("userProperties1", "source1");
+        plugin.systemProperties = systemProperties;
+        Map<String, String> systemPropertyVariables = new HashMap<>();
+        systemPropertyVariables.put("systemProperties3", "source3");
+        systemPropertyVariables.put("userProperties1", "source3");
+        plugin.systemPropertyVariables = systemPropertyVariables;
+        SurefireProperties properties = plugin.setupProperties();
+        assertThat(properties)
+                .containsOnly(
+                        Assertions.entry("systemProperties1", "source1"),
+                        Assertions.entry("systemProperties2", "source2"),
+                        Assertions.entry("systemProperties3", "source3"),
+                        Assertions.entry("userProperties1", "source4"),
+                        Assertions.entry("localRepository", 
"local/repository/path"),
+                        Assertions.entry("basedir", new 
File("target").getAbsolutePath()));
+
+        // and without user properties
+        plugin.promoteUserPropertiesToSystemProperties = false;
+        properties = plugin.setupProperties();
+        assertThat(properties)
+                .containsOnly(
+                        Assertions.entry("systemProperties1", "source1"),
+                        Assertions.entry("systemProperties2", "source2"),
+                        Assertions.entry("systemProperties3", "source3"),
+                        Assertions.entry("userProperties1", "source3"),
+                        Assertions.entry("localRepository", 
"local/repository/path"),
+                        Assertions.entry("basedir", new 
File("target").getAbsolutePath()));
+    }
+
     private static File mockFile(String absolutePath) {
         File f = mock(File.class);
         when(f.getAbsolutePath()).thenReturn(absolutePath);
diff --git 
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefirePropertiesTest.java
 
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefirePropertiesTest.java
index 9d3e79702..a0ad72357 100644
--- 
a/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefirePropertiesTest.java
+++ 
b/maven-surefire-common/src/test/java/org/apache/maven/plugin/surefire/SurefirePropertiesTest.java
@@ -18,8 +18,11 @@
  */
 package org.apache.maven.plugin.surefire;
 
+import java.util.Arrays;
 import java.util.Enumeration;
 import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.Map;
 import java.util.Properties;
 import java.util.SortedSet;
 import java.util.TreeSet;
@@ -112,6 +115,17 @@ public class SurefirePropertiesTest extends TestCase {
         assertEquals("b", it.next());
     }
 
+    public void testCopyPropertiesFrom() {
+        SurefireProperties orderedProperties = new SurefireProperties();
+        Map<String, String> properties = new LinkedHashMap<>();
+        properties.put("property1", "value");
+        properties.put("property2", "value");
+        orderedProperties.putAll(properties);
+        orderedProperties.put("property3", "value");
+        // check return value containing all overwritten property names
+        assertEquals(Arrays.asList("property1", "property2"), 
orderedProperties.copyPropertiesFrom(properties));
+    }
+
     private static int size(Iterator<?> iterator) {
         int count = 0;
         while (iterator.hasNext()) {
diff --git a/maven-surefire-plugin/pom.xml b/maven-surefire-plugin/pom.xml
index 71de0eff6..7c2b63e35 100644
--- a/maven-surefire-plugin/pom.xml
+++ b/maven-surefire-plugin/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <groupId>org.apache.maven.plugins</groupId>
diff --git 
a/maven-surefire-plugin/src/site/apt/examples/system-properties.apt.vm 
b/maven-surefire-plugin/src/site/apt/examples/system-properties.apt.vm
index 9c1c3cb15..aceded1ac 100644
--- a/maven-surefire-plugin/src/site/apt/examples/system-properties.apt.vm
+++ b/maven-surefire-plugin/src/site/apt/examples/system-properties.apt.vm
@@ -3,6 +3,7 @@
   ------
   Allan Ramirez
   Dan Tran
+  Konrad Windszus
   ------
   2010-01-09
   ------
@@ -29,12 +30,15 @@
 
 Using System Properties
 
-  There are two ways to add a list of system properties to ${thisPlugin}:
+%{toc|section=0|fromDepth=2}
+
+
+  There are different parameters which affect the system properties passed to 
${thisPlugin} providers:
 
 * systemPropertyVariables
 
-  This configuration is the replacement of the deprecated 
<<<systemProperties>>>.  It can accept any value
-  from Maven's properties that can be converted <<to a String value>>.
+  This configuration is the replacement of the deprecated 
<<<systemProperties>>>. It can accept any 
{{{https://maven.apache.org/ref/3-LATEST/maven-model-builder/#model-interpolation}expression
 value}}
+  referencing Maven's properties that can be converted <<to a String value>> 
or arbitrary literals.
 
 +---+
 <project>
@@ -59,8 +63,11 @@ Using System Properties
 </project>
 +---+
 
+* systemPropertiesFile
+
+  This configuration allows to add system properties through an external 
properties file whose path is given via this plugin parameter.
 
-* systemProperties ( Deprecated )
+* systemProperties (Deprecated)
 
 +---+
 <project>
@@ -130,7 +137,24 @@ Using System Properties
    </systemProperties>
 +---+
 
-Special VM Properties
+* Effective System Properties
+
+  The effective system properties are merged from the following sources:
+
+  [[1]] <<<systemProperties>>>
+
+  [[2]] <<<systemPropertiesFile>>>
+
+  [[3]] <<<systemPropertyVariables>>>
+
+  [[4]] 
{{{https://maven.apache.org/ref/3-LATEST/maven-core/apidocs/org/apache/maven/execution/MavenSession.html#getUserProperties()}User
 properties from the current Maven session}} (if 
<<<promoteUserPropertiesToSystemProperties>>> is not set to <<<false>>>)
+
+  []
+
+  where latter items may overwrite properties with the same name of former 
items.
+
+
+* Special VM Properties
 
   Some system properties must be set on the command line of the forked VM, and 
cannot be set after the
   VM has been started. These properties must be added to the <<<argLine>>> 
parameter of the Surefire plugin. E.g.,
diff --git a/maven-surefire-report-plugin/pom.xml 
b/maven-surefire-report-plugin/pom.xml
index 9f6a406e4..474b73ece 100644
--- a/maven-surefire-report-plugin/pom.xml
+++ b/maven-surefire-report-plugin/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <groupId>org.apache.maven.plugins</groupId>
diff --git a/pom.xml b/pom.xml
index 10d02fc3e..c773af05d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -28,7 +28,7 @@
 
   <groupId>org.apache.maven.surefire</groupId>
   <artifactId>surefire</artifactId>
-  <version>3.3.2-SNAPSHOT</version>
+  <version>3.4.0-SNAPSHOT</version>
   <packaging>pom</packaging>
 
   <name>Apache Maven Surefire</name>
@@ -106,7 +106,7 @@
     <maven.compiler.testTarget>1.${javaVersion}</maven.compiler.testTarget>
     <jvm9ArgsTests />
     <jvm.args.tests>${jvm9ArgsTests} -Xms32m -Xmx144m 
-XX:SoftRefLRUPolicyMSPerMB=50 -Djava.awt.headless=true 
-Djdk.net.URLClassPath.disableClassPathURLCheck=true</jvm.args.tests>
-    
<project.build.outputTimestamp>2024-07-07T17:48:17Z</project.build.outputTimestamp>
+    
<project.build.outputTimestamp>2024-07-15T13:01:03Z</project.build.outputTimestamp>
   </properties>
 
   <dependencyManagement>
diff --git a/surefire-api/pom.xml b/surefire-api/pom.xml
index 0f4f767d6..b36676c3e 100644
--- a/surefire-api/pom.xml
+++ b/surefire-api/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-api</artifactId>
diff --git a/surefire-booter/pom.xml b/surefire-booter/pom.xml
index bfb637475..d256834b3 100644
--- a/surefire-booter/pom.xml
+++ b/surefire-booter/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-booter</artifactId>
diff --git a/surefire-extensions-api/pom.xml b/surefire-extensions-api/pom.xml
index 9017bdfa6..9dbb677e2 100644
--- a/surefire-extensions-api/pom.xml
+++ b/surefire-extensions-api/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-extensions-api</artifactId>
diff --git a/surefire-extensions-spi/pom.xml b/surefire-extensions-spi/pom.xml
index 32ecf4b51..c072b3d4b 100644
--- a/surefire-extensions-spi/pom.xml
+++ b/surefire-extensions-spi/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-extensions-spi</artifactId>
diff --git a/surefire-grouper/pom.xml b/surefire-grouper/pom.xml
index 9e625f1f1..50cb33193 100644
--- a/surefire-grouper/pom.xml
+++ b/surefire-grouper/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-grouper</artifactId>
diff --git a/surefire-its/pom.xml b/surefire-its/pom.xml
index 8d18714f1..2559d357d 100644
--- a/surefire-its/pom.xml
+++ b/surefire-its/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-its</artifactId>
diff --git a/surefire-logger-api/pom.xml b/surefire-logger-api/pom.xml
index 84593953d..92f44bb46 100644
--- a/surefire-logger-api/pom.xml
+++ b/surefire-logger-api/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-logger-api</artifactId>
diff --git a/surefire-providers/common-java5/pom.xml 
b/surefire-providers/common-java5/pom.xml
index 39fcc6647..98d63fbc6 100644
--- a/surefire-providers/common-java5/pom.xml
+++ b/surefire-providers/common-java5/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire-providers</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>common-java5</artifactId>
diff --git a/surefire-providers/common-junit3/pom.xml 
b/surefire-providers/common-junit3/pom.xml
index 17eb8b22d..8fa9e5464 100644
--- a/surefire-providers/common-junit3/pom.xml
+++ b/surefire-providers/common-junit3/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire-providers</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>common-junit3</artifactId>
diff --git a/surefire-providers/common-junit4/pom.xml 
b/surefire-providers/common-junit4/pom.xml
index f66db5849..0ef6fc660 100644
--- a/surefire-providers/common-junit4/pom.xml
+++ b/surefire-providers/common-junit4/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire-providers</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>common-junit4</artifactId>
diff --git a/surefire-providers/common-junit48/pom.xml 
b/surefire-providers/common-junit48/pom.xml
index a223dcbd0..ce3ba24ce 100644
--- a/surefire-providers/common-junit48/pom.xml
+++ b/surefire-providers/common-junit48/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire-providers</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>common-junit48</artifactId>
diff --git a/surefire-providers/pom.xml b/surefire-providers/pom.xml
index c030e6703..eff68a63c 100644
--- a/surefire-providers/pom.xml
+++ b/surefire-providers/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-providers</artifactId>
diff --git a/surefire-providers/surefire-junit-platform/pom.xml 
b/surefire-providers/surefire-junit-platform/pom.xml
index 66bb62dc9..09011343f 100644
--- a/surefire-providers/surefire-junit-platform/pom.xml
+++ b/surefire-providers/surefire-junit-platform/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire-providers</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-junit-platform</artifactId>
diff --git a/surefire-providers/surefire-junit3/pom.xml 
b/surefire-providers/surefire-junit3/pom.xml
index ab337b748..7505164cb 100644
--- a/surefire-providers/surefire-junit3/pom.xml
+++ b/surefire-providers/surefire-junit3/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire-providers</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-junit3</artifactId>
diff --git a/surefire-providers/surefire-junit4/pom.xml 
b/surefire-providers/surefire-junit4/pom.xml
index 898cf569b..194b93a7f 100644
--- a/surefire-providers/surefire-junit4/pom.xml
+++ b/surefire-providers/surefire-junit4/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire-providers</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-junit4</artifactId>
diff --git a/surefire-providers/surefire-junit47/pom.xml 
b/surefire-providers/surefire-junit47/pom.xml
index 45ee17904..d6d6c1b64 100644
--- a/surefire-providers/surefire-junit47/pom.xml
+++ b/surefire-providers/surefire-junit47/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire-providers</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-junit47</artifactId>
diff --git a/surefire-providers/surefire-testng-utils/pom.xml 
b/surefire-providers/surefire-testng-utils/pom.xml
index 27c7ced49..5e1777e8f 100644
--- a/surefire-providers/surefire-testng-utils/pom.xml
+++ b/surefire-providers/surefire-testng-utils/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire-providers</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-testng-utils</artifactId>
diff --git a/surefire-providers/surefire-testng/pom.xml 
b/surefire-providers/surefire-testng/pom.xml
index db4d31371..d99d636c7 100644
--- a/surefire-providers/surefire-testng/pom.xml
+++ b/surefire-providers/surefire-testng/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire-providers</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-testng</artifactId>
diff --git a/surefire-report-parser/pom.xml b/surefire-report-parser/pom.xml
index 609031a51..eb6d511d3 100644
--- a/surefire-report-parser/pom.xml
+++ b/surefire-report-parser/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-report-parser</artifactId>
diff --git a/surefire-shadefire/pom.xml b/surefire-shadefire/pom.xml
index cf6f3d3bf..2afbe11ef 100644
--- a/surefire-shadefire/pom.xml
+++ b/surefire-shadefire/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-shadefire</artifactId>
diff --git a/surefire-shared-utils/pom.xml b/surefire-shared-utils/pom.xml
index 33077c7a0..17cb31719 100644
--- a/surefire-shared-utils/pom.xml
+++ b/surefire-shared-utils/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.maven.surefire</groupId>
     <artifactId>surefire</artifactId>
-    <version>3.3.2-SNAPSHOT</version>
+    <version>3.4.0-SNAPSHOT</version>
   </parent>
 
   <artifactId>surefire-shared-utils</artifactId>


Reply via email to