Skip to content

Conversation

@gnodet
Copy link
Contributor

@gnodet gnodet commented Oct 30, 2025

Problem

When running integration tests, we see duplicate and confusing output like:

[INFO] [stdout] Running integration tests for Maven 4.0.0-rc-4
[INFO] [stdout]         using Maven executable: mvn
[INFO] [stdout]         with verifier.forkMode: AUTO
[INFO] [stdout] Running integration tests for Maven 4.1.0-SNAPSHOT
[INFO] [stdout]         using Maven executable: mvn
[INFO] [stdout]         with verifier.forkMode: AUTO
[INFO] [stdout] Running integration tests for Maven 4.1.0-SNAPSHOT
[INFO] [stdout]         using Maven executable: mvn
[INFO] [stdout]         with verifier.forkMode: AUTO

The first line shows the wrong version (from the outer Maven process), and the subsequent lines are redundant output from forked JVMs.

Root Cause

The TestSuiteOrdering static block was printing Maven version information every time the class was loaded, which happens:

  1. Once in the outer Maven process (showing incorrect version 4.0.0-rc-4)
  2. Multiple times in forked JVMs (showing correct version 4.1.0-SNAPSHOT but redundantly)

Solution

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 like MavenITmng3652UserAgentHeaderTest)
  • ✅ Still writes version info to target/info.txt for debugging
  • ❌ Removes the problematic console output

Benefits

  • Eliminates confusing duplicate output during integration test execution
  • Fixes incorrect version display from outer Maven process
  • Maintains all functionality that tests actually depend on
  • Simpler, cleaner code

Testing

The change preserves all existing functionality while removing only the problematic console output. Integration tests will continue to work as before, just without the duplicate version messages.

Files Changed

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

Pull Request opened by Augment Code with guidance from the PR author

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.
@gnodet gnodet added the build Pull requests that change the build process label Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Pull requests that change the build process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant