From 51643e18967fa8b6db807102c74b8409dbd61437 Mon Sep 17 00:00:00 2001 From: Gerd Aschemann Date: Wed, 19 Aug 2026 21:44:40 +0200 Subject: [PATCH] Fix aspectj-compiler IT for Maven 4 stdout prefix The aspectj-compiler integration test's verify.groovy asserts that a raw, contiguous block of AspectJ-woven test output appears verbatim in build.log. Maven 4's console reporter prefixes surefire lines with "[INFO] " and forked test stdout with "[INFO] [stdout] ", so the block is no longer a substring and the assertion fails (the inner build itself is BUILD SUCCESS). Strip the "[INFO] " / "[INFO] [stdout] " line prefixes before the contains check. This is a no-op under Maven 3 (lines are unprefixed there) and restores the match under Maven 4. Closes #508 --- .../src/main/it/aspectj-compiler/verify.groovy | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plexus-compiler-its/src/main/it/aspectj-compiler/verify.groovy b/plexus-compiler-its/src/main/it/aspectj-compiler/verify.groovy index 02a72b642..1b7add224 100644 --- a/plexus-compiler-its/src/main/it/aspectj-compiler/verify.groovy +++ b/plexus-compiler-its/src/main/it/aspectj-compiler/verify.groovy @@ -32,4 +32,11 @@ Running application execution(String org.acme.Application.greet(String)) call(void org.junit.Assert.assertTrue(boolean))""".normalize() -assert content.contains( junitLog ) +// Maven 4's console reporter prefixes surefire lines with "[INFO] " and forked +// test stdout with "[INFO] [stdout] "; strip those so the woven-output block +// matches under both Maven 3 (unprefixed) and Maven 4. +def unprefixed = content.readLines() + .collect { it.replaceFirst( ~/^\[INFO\] (\[stdout\] )?/, '' ) } + .join( '\n' ) + +assert unprefixed.contains( junitLog )