Commit 6fed665
authored
Add command line information to Verifier log files for easier IT reproduction (#11366)
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.
The command line information includes:
- Full path to Maven executable with all arguments
- Environment variables (MAVEN_OPTS, MAVEN_SKIP_RC, custom env vars)
- JVM system properties
- Working directory
- Execution mode (EMBEDDED, FORKED, AUTO)
The information is prepended to the log file after Maven execution completes,
ensuring it appears at the top without being overwritten by Maven's logging.
Example output:
# Command line used for this execution:
/opt/maven/bin/mvn -l log.txt --errors --batch-mode validate
# MAVEN_OPTS=-Duser.home=/path/to/user.home
# Working directory: /path/to/test/project
# Execution mode: AUTO
* Skip command line info in log files when quiet logging is enabled
The MavenITmng4387QuietLoggingTest was failing because it expects empty log files
when using the -q (quiet) flag, but the command line information was still being
added to the log file.
This change adds detection for quiet logging (-q or --quiet flags) and skips
adding the command line information when quiet logging is enabled, respecting
the intent of quiet logging to minimize output.
Changes:
- Added isQuietLogging() method to detect -q/--quiet flags
- Modified execute() to skip command line info when quiet logging is enabled
- Maintains full functionality for normal logging while respecting quiet mode1 parent 36c4d10 commit 6fed665
File tree
1 file changed
+104
-0
lines changed- its/core-it-support/maven-it-helper/src/main/java/org/apache/maven/it
1 file changed
+104
-0
lines changedLines changed: 104 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
273 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
274 | 299 | | |
275 | 300 | | |
276 | 301 | | |
| |||
418 | 443 | | |
419 | 444 | | |
420 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
421 | 525 | | |
422 | 526 | | |
423 | 527 | | |
| |||
0 commit comments