Skip to content

Commit d749fbc

Browse files
authored
Remove duplicate integration test version output (#11360)
The TestSuiteOrdering static block was printing Maven version information every time the class was loaded, which happened multiple times: - Once from the outer Maven process (showing incorrect version) - Multiple times from forked JVMs (showing correct but redundant version) This change removes the console output while preserving essential functionality: - Still clears system properties for test isolation - Still sets maven.version system property (needed by some tests) - Still writes version info to target/info.txt for debugging Fixes the confusing duplicate output during integration test execution.
1 parent 6fed665 commit d749fbc

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

its/core-it-suite/src/test/java/org/apache/maven/it/TestSuiteOrdering.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
import java.util.Comparator;
2525
import java.util.regex.Matcher;
2626
import java.util.regex.Pattern;
27-
28-
import org.apache.maven.cling.executor.ExecutorHelper;
2927
import org.junit.jupiter.api.ClassDescriptor;
3028
import org.junit.jupiter.api.ClassOrderer;
3129
import org.junit.jupiter.api.ClassOrdererContext;
@@ -60,19 +58,12 @@ private static void infoProperty(PrintStream info, String property) {
6058
System.clearProperty("maven.conf");
6159
System.clearProperty("classworlds.conf");
6260

61+
// Set maven.version system property (needed by some tests)
6362
Verifier verifier = new Verifier("", false);
6463
String mavenVersion = verifier.getMavenVersion();
65-
String executable = verifier.getExecutable();
66-
ExecutorHelper.Mode defaultMode = verifier.getDefaultMode();
67-
68-
System.out.println("Running integration tests for Maven " + mavenVersion + System.lineSeparator()
69-
+ "\tusing Maven executable: " + executable + System.lineSeparator()
70-
+ "\twith verifier.forkMode: " + defaultMode);
71-
7264
System.setProperty("maven.version", mavenVersion);
7365

7466
String basedir = System.getProperty("basedir", ".");
75-
7667
try (PrintStream info = new PrintStream(Files.newOutputStream(Paths.get(basedir, "target/info.txt")))) {
7768
infoProperty(info, "maven.version");
7869
infoProperty(info, "java.version");

0 commit comments

Comments
 (0)