gnodet opened a new pull request, #11366: URL: https://github.com/apache/maven/pull/11366
## Summary When running integration tests, the Verifier dumps output to a log file (usually log.txt). This change adds the full command line used for execution at the beginning of the log file to make it easy to reproduce the test outside the IT environment. ## Changes - Added `formatCommandLine()` method to generate human-readable command line representation - Modified `execute()` method to prepend command line information to log file after Maven execution - Includes comprehensive execution context: executable path, arguments, environment variables, JVM properties, working directory, and execution mode ## Benefits - **Easy Reproduction**: Developers can copy the exact command line from log files to reproduce IT tests manually - **Complete Context**: All relevant execution context is captured for debugging - **Non-Intrusive**: Doesn't interfere with Maven's normal execution or logging - **Error Handling**: Failures in command line formatting don't break test execution ## Example Output ``` # Command line used for this execution: /opt/maven/bin/mvn -l log.txt --errors --batch-mode validate -Dtest.property=value # Environment variables: # TEST_ENV=test_value # MAVEN_OPTS=-Duser.home=/path/to/user.home -Dsystem.prop=value # MAVEN_SKIP_RC=true # Working directory: /path/to/test/project # Execution mode: AUTO [INFO] Scanning for projects... ... ``` ## Testing - Compiled successfully with existing Maven build - Tested with simple and complex scenarios (custom arguments, system properties, environment variables) - Verified command line appears at beginning of log file - Confirmed no impact on normal Maven execution --- Pull Request opened by [Augment Code](https://www.augmentcode.com/) with guidance from the PR author -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
