From 68a6fef6c976e9c2d943bda631aef7f4db92583d Mon Sep 17 00:00:00 2001 From: mariuszs Date: Wed, 8 Apr 2026 16:56:28 +0200 Subject: [PATCH 1/7] feat(mvn): add Maven wrapper (mvnw) support and test goal - Support ./mvnw and mvnw as command prefixes alongside mvn - Add missing `test` goal to Maven filter match pattern - Extend strip patterns: Scanning for projects, Compiling N source files, Recompiling the module, empty [ERROR], [Help] boilerplate - Add 6 new inline tests based on real Maven compilation output - Update spring-boot.toml to also match mvnw/gradlew wrappers - Add mvnw/./mvnw to rewrite_prefixes in discover rules --- src/discover/rules.rs | 4 +- src/filters/mvn-build.toml | 89 +++++++++++++++++++++++++++++++++++- src/filters/spring-boot.toml | 2 +- 3 files changed, 91 insertions(+), 4 deletions(-) diff --git a/src/discover/rules.rs b/src/discover/rules.rs index b315edd77..9eee138ce 100644 --- a/src/discover/rules.rs +++ b/src/discover/rules.rs @@ -486,9 +486,9 @@ pub const RULES: &[RtkRule] = &[ subcmd_status: &[], }, RtkRule { - pattern: r"^mvn\s+(compile|package|clean|install)\b", + pattern: r"^(\./)?mvnw?\s+(compile|package|clean|install|test)\b", rtk_cmd: "rtk mvn", - rewrite_prefixes: &["mvn"], + rewrite_prefixes: &["./mvnw", "mvnw", "mvn"], category: "Build", savings_pct: 70.0, subcmd_savings: &[], diff --git a/src/filters/mvn-build.toml b/src/filters/mvn-build.toml index 430a7f0cd..4445e34a4 100644 --- a/src/filters/mvn-build.toml +++ b/src/filters/mvn-build.toml @@ -1,13 +1,18 @@ [filters.mvn-build] description = "Compact Maven build output" -match_command = "^mvn\\s+(compile|package|clean|install)\\b" +match_command = "^(\\.?\\/?)mvnw?\\s+(compile|package|clean|install|test)\\b" strip_ansi = true strip_lines_matching = [ "^\\[INFO\\] ---", "^\\[INFO\\] Building\\s", + "^\\[INFO\\] Scanning for projects", + "^\\[INFO\\] Compiling \\d+ source file", + "^\\[INFO\\] Recompiling the module", "^\\[INFO\\] Downloading\\s", "^\\[INFO\\] Downloaded\\s", "^\\[INFO\\]\\s*$", + "^\\[ERROR\\]\\s*$", + "^\\[ERROR\\] -> \\[Help", "^\\s*$", "^Downloading:", "^Downloaded:", @@ -42,3 +47,85 @@ input = """ [INFO] Finished at: 2024-01-15T10:30:00Z """ expected = "[INFO] BUILD SUCCESS\n[INFO] Total time: 4.123 s\n[INFO] Finished at: 2024-01-15T10:30:00Z" + +[[tests.mvn-build]] +name = "mvn test failure preserves error and summary" +input = """ +[INFO] --- +[INFO] Building myapp 1.0-SNAPSHOT +[INFO] Downloading org.apache.maven.plugins:maven-surefire-plugin:3.2.5 +[INFO] Downloaded org.apache.maven.plugins:maven-surefire-plugin:3.2.5 +[INFO] +[ERROR] Tests run: 5, Failures: 1, Errors: 0, Skipped: 0 +[INFO] BUILD FAILURE +[INFO] Total time: 3.456 s +""" +expected = "[ERROR] Tests run: 5, Failures: 1, Errors: 0, Skipped: 0\n[INFO] BUILD FAILURE\n[INFO] Total time: 3.456 s" + +[[tests.mvn-build]] +name = "clean success strips all noise" +input = """ +[INFO] Scanning for projects... +[INFO] --- maven-compiler-plugin:3.13.0:compile (default-compile) --- +[INFO] Compiling 5 source files with javac [debug target 25] to target/classes +[INFO] BUILD SUCCESS +[INFO] Total time: 1.234 s +""" +expected = "[INFO] BUILD SUCCESS\n[INFO] Total time: 1.234 s" + +[[tests.mvn-build]] +name = "single compilation error preserves error details" +input = """ +[INFO] Scanning for projects... +[INFO] +[INFO] --- maven-compiler-plugin:3.13.0:compile (default-compile) --- +[INFO] Recompiling the module because of changed source code. +[INFO] Compiling 5 source files with javac [debug target 25] to target/classes +[ERROR] /home/user/my-project/src/main/java/com/example/MyService.java:[42,15] cannot find symbol +[INFO] symbol: variable foo +[INFO] location: class com.example.MyService +[ERROR] COMPILATION FAILURE +[ERROR] +[ERROR] -> [Help 1] +""" +expected = "[ERROR] /home/user/my-project/src/main/java/com/example/MyService.java:[42,15] cannot find symbol\n[INFO] symbol: variable foo\n[INFO] location: class com.example.MyService\n[ERROR] COMPILATION FAILURE" + +[[tests.mvn-build]] +name = "multiple compilation errors preserved" +input = """ +[INFO] Scanning for projects... +[INFO] --- maven-compiler-plugin:3.13.0:compile (default-compile) --- +[INFO] Compiling 10 source files with javac [debug target 25] to target/classes +[ERROR] /home/user/my-project/src/main/java/com/example/MyService.java:[42,15] cannot find symbol +[ERROR] /home/user/my-project/src/main/java/com/example/MyService.java:[55,10] incompatible types: String cannot be converted to int +[ERROR] /home/user/my-project/src/main/java/com/example/OtherClass.java:[10,20] method doStuff() is not defined +[ERROR] COMPILATION FAILURE +[ERROR] -> [Help 1] +""" +expected = "[ERROR] /home/user/my-project/src/main/java/com/example/MyService.java:[42,15] cannot find symbol\n[ERROR] /home/user/my-project/src/main/java/com/example/MyService.java:[55,10] incompatible types: String cannot be converted to int\n[ERROR] /home/user/my-project/src/main/java/com/example/OtherClass.java:[10,20] method doStuff() is not defined\n[ERROR] COMPILATION FAILURE" + +[[tests.mvn-build]] +name = "mixed errors and warnings preserved" +input = """ +[INFO] Scanning for projects... +[INFO] --- maven-compiler-plugin:3.13.0:compile (default-compile) --- +[INFO] Compiling 8 source files with javac [debug target 25] to target/classes +[WARNING] /home/user/my-project/src/main/java/com/example/OldService.java:[10,5] [deprecation] doStuff() in LegacyApi has been deprecated +[ERROR] /home/user/my-project/src/main/java/com/example/MyService.java:[42,15] cannot find symbol +[WARNING] /home/user/my-project/src/main/java/com/example/OldService.java:[25,12] [unchecked] unchecked cast +[ERROR] /home/user/my-project/src/main/java/com/example/MyService.java:[55,10] method not found +[ERROR] COMPILATION FAILURE +""" +expected = "[WARNING] /home/user/my-project/src/main/java/com/example/OldService.java:[10,5] [deprecation] doStuff() in LegacyApi has been deprecated\n[ERROR] /home/user/my-project/src/main/java/com/example/MyService.java:[42,15] cannot find symbol\n[WARNING] /home/user/my-project/src/main/java/com/example/OldService.java:[25,12] [unchecked] unchecked cast\n[ERROR] /home/user/my-project/src/main/java/com/example/MyService.java:[55,10] method not found\n[ERROR] COMPILATION FAILURE" + +[[tests.mvn-build]] +name = "warnings-only build keeps warnings and success" +input = """ +[INFO] Scanning for projects... +[INFO] --- maven-compiler-plugin:3.13.0:compile (default-compile) --- +[INFO] Compiling 3 source files with javac [debug target 25] to target/classes +[WARNING] /home/user/my-project/src/main/java/com/example/OldService.java:[10,5] [deprecation] doStuff() in LegacyApi has been deprecated +[WARNING] /home/user/my-project/src/main/java/com/example/OldService.java:[25,12] [unchecked] unchecked cast +[INFO] BUILD SUCCESS +""" +expected = "[WARNING] /home/user/my-project/src/main/java/com/example/OldService.java:[10,5] [deprecation] doStuff() in LegacyApi has been deprecated\n[WARNING] /home/user/my-project/src/main/java/com/example/OldService.java:[25,12] [unchecked] unchecked cast\n[INFO] BUILD SUCCESS" diff --git a/src/filters/spring-boot.toml b/src/filters/spring-boot.toml index 5ec03e58c..4c1b7d222 100644 --- a/src/filters/spring-boot.toml +++ b/src/filters/spring-boot.toml @@ -1,6 +1,6 @@ [filters.spring-boot] description = "Compact Spring Boot output — strip banner and verbose startup logs, keep key events" -match_command = "^(mvn\\s+spring-boot:run|java\\s+-jar.*\\.jar|gradle\\s+.*bootRun)" +match_command = "^((\\.?\\/?)mvnw?\\s+spring-boot:run|java\\s+-jar.*\\.jar|(gradle|gradlew|\\./)gradlew?\\s+.*bootRun)" strip_ansi = true keep_lines_matching = [ "Started\\s.*\\sin\\s", From c3c22e0c0fd345ded3942b71400c9716acb3df93 Mon Sep 17 00:00:00 2001 From: mariuszs Date: Wed, 8 Apr 2026 17:12:08 +0200 Subject: [PATCH 2/7] feat(mvn): add dedicated mvn-test filter with failures-only output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Split `test` goal from mvn-build into a separate mvn-test.toml filter that uses keep_lines_matching for aggressive filtering (failures-only). - mvn-test uses replace stage to blank surefire boilerplate before keep - Keeps only: [ERROR], [WARNING], BUILD status, test summaries, assertion details (expected/but was), stack traces, Total time - Strips: [Help] links, "See surefire-reports", "Re-run Maven" hints - 3 inline tests from real maven-mcp project logs - Update builtin filter count: 58 → 59 --- src/core/toml_filter.rs | 10 ++-- src/filters/mvn-build.toml | 16 +------ src/filters/mvn-test.toml | 94 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 20 deletions(-) create mode 100644 src/filters/mvn-test.toml diff --git a/src/core/toml_filter.rs b/src/core/toml_filter.rs index bd294f8af..0a2400b0d 100644 --- a/src/core/toml_filter.rs +++ b/src/core/toml_filter.rs @@ -1613,8 +1613,8 @@ match_command = "^make\\b" let filters = make_filters(BUILTIN_TOML); assert_eq!( filters.len(), - 58, - "Expected exactly 58 built-in filters, got {}. \ + 59, + "Expected exactly 59 built-in filters, got {}. \ Update this count when adding/removing filters in src/filters/.", filters.len() ); @@ -1671,11 +1671,11 @@ expected = "output line 1\noutput line 2" let combined = format!("{}\n\n{}", BUILTIN_TOML, new_filter); let filters = make_filters(&combined); - // All 58 existing filters still present + 1 new = 59 + // All 59 existing filters still present + 1 new = 60 assert_eq!( filters.len(), - 59, - "Expected 59 filters after concat (58 built-in + 1 new)" + 60, + "Expected 60 filters after concat (59 built-in + 1 new)" ); // New filter is discoverable diff --git a/src/filters/mvn-build.toml b/src/filters/mvn-build.toml index 4445e34a4..8750b3b1b 100644 --- a/src/filters/mvn-build.toml +++ b/src/filters/mvn-build.toml @@ -1,6 +1,6 @@ [filters.mvn-build] description = "Compact Maven build output" -match_command = "^(\\.?\\/?)mvnw?\\s+(compile|package|clean|install|test)\\b" +match_command = "^(\\.?\\/?)mvnw?\\s+(compile|package|clean|install)\\b" strip_ansi = true strip_lines_matching = [ "^\\[INFO\\] ---", @@ -48,20 +48,6 @@ input = """ """ expected = "[INFO] BUILD SUCCESS\n[INFO] Total time: 4.123 s\n[INFO] Finished at: 2024-01-15T10:30:00Z" -[[tests.mvn-build]] -name = "mvn test failure preserves error and summary" -input = """ -[INFO] --- -[INFO] Building myapp 1.0-SNAPSHOT -[INFO] Downloading org.apache.maven.plugins:maven-surefire-plugin:3.2.5 -[INFO] Downloaded org.apache.maven.plugins:maven-surefire-plugin:3.2.5 -[INFO] -[ERROR] Tests run: 5, Failures: 1, Errors: 0, Skipped: 0 -[INFO] BUILD FAILURE -[INFO] Total time: 3.456 s -""" -expected = "[ERROR] Tests run: 5, Failures: 1, Errors: 0, Skipped: 0\n[INFO] BUILD FAILURE\n[INFO] Total time: 3.456 s" - [[tests.mvn-build]] name = "clean success strips all noise" input = """ diff --git a/src/filters/mvn-test.toml b/src/filters/mvn-test.toml new file mode 100644 index 000000000..c86e2af46 --- /dev/null +++ b/src/filters/mvn-test.toml @@ -0,0 +1,94 @@ +[filters.mvn-test] +description = "Compact Maven test output — failures only, strip surefire boilerplate" +match_command = "^(\\.?\\/?)mvnw?\\s+test\\b" +strip_ansi = true +# Stage 2: blank out Maven surefire boilerplate before keep filter +replace = [ + { pattern = "^\\[ERROR\\]\\s*$", replacement = "" }, + { pattern = "^\\[ERROR\\] -> \\[Help.*", replacement = "" }, + { pattern = "^\\[ERROR\\] \\[Help \\d+\\].*", replacement = "" }, + { pattern = "^\\[ERROR\\] See .*/surefire-reports.*", replacement = "" }, + { pattern = "^\\[ERROR\\] See dump files.*", replacement = "" }, + { pattern = "^\\[ERROR\\] To see the full stack trace.*", replacement = "" }, + { pattern = "^\\[ERROR\\] Re-run Maven.*", replacement = "" }, + { pattern = "^\\[ERROR\\] For more information about.*", replacement = "" }, +] +keep_lines_matching = [ + "\\[ERROR\\]", + "\\[WARNING\\]", + "BUILD (SUCCESS|FAILURE)", + "Tests run:", + "<<< FAILURE", + "<<< ERROR", + "^\\s+at\\s", + "Caused by:", + "Exception", + "expected:", + "but was:", + "Expected", + "Total time:", +] +max_lines = 50 +on_empty = "mvn test: ok (all tests passed)" + +[[tests.mvn-test]] +name = "all tests pass returns ok" +input = """ +[INFO] Scanning for projects... +[INFO] --- maven-compiler-plugin:3.13.0:compile (default-compile) --- +[INFO] Compiling 5 source files with javac [debug target 25] to target/classes +[INFO] --- maven-surefire-plugin:3.5.4:test (default-test) --- +[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider +[INFO] BUILD SUCCESS +[INFO] Total time: 3.456 s +""" +expected = "[INFO] BUILD SUCCESS\n[INFO] Total time: 3.456 s" + +[[tests.mvn-test]] +name = "test failure preserves error details and strips boilerplate" +input = """ +[INFO] Scanning for projects... +[INFO] --- maven-surefire-plugin:3.5.4:test (default-test) --- +[ERROR] Tests run: 27, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.073 s <<< FAILURE! -- in io.github.mavenmcp.parser.DependencyTreeParserTest +[ERROR] io.github.mavenmcp.parser.DependencyTreeParserTest.shouldMatchCaseInsensitively -- Time elapsed: 0.004 s <<< FAILURE! +java.lang.AssertionError: +Expected size: 1 but was: 3 +[INFO] +[INFO] BUILD FAILURE +[INFO] Total time: 0.611 s +[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.4:test (default-test) on project maven-mcp: There are test failures. +[ERROR] +[ERROR] See /home/mariusz/projects/maven-mcp/target/surefire-reports for the individual test results. +[ERROR] See dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream. +[ERROR] -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException +""" +expected = "[ERROR] Tests run: 27, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.073 s <<< FAILURE! -- in io.github.mavenmcp.parser.DependencyTreeParserTest\n[ERROR] io.github.mavenmcp.parser.DependencyTreeParserTest.shouldMatchCaseInsensitively -- Time elapsed: 0.004 s <<< FAILURE!\nExpected size: 1 but was: 3\n[INFO] BUILD FAILURE\n[INFO] Total time: 0.611 s\n[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.4:test (default-test) on project maven-mcp: There are test failures." + +[[tests.mvn-test]] +name = "multiple test failures with assertion details" +input = """ +[ERROR] DependencyTreeParserTest.shouldParseDirectDependency:35 +expected: "org.slf4j" + but was: "com.google.guava" +[ERROR] DependencyTreeParserTest.shouldParseSimpleTree:22 +expected: "com.example" + but was: "org.slf4j" +[ERROR] Tests run: 17, Failures: 7, Errors: 0, Skipped: 0 +[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.4:test (default-test) on project maven-mcp: There are test failures. +[ERROR] +[ERROR] See /home/mariusz/projects/maven-mcp/target/surefire-reports for the individual test results. +[ERROR] -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException +""" +expected = "[ERROR] DependencyTreeParserTest.shouldParseDirectDependency:35\nexpected: \"org.slf4j\"\n but was: \"com.google.guava\"\n[ERROR] DependencyTreeParserTest.shouldParseSimpleTree:22\nexpected: \"com.example\"\n but was: \"org.slf4j\"\n[ERROR] Tests run: 17, Failures: 7, Errors: 0, Skipped: 0\n[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.4:test (default-test) on project maven-mcp: There are test failures." From 9854463419c22fddd6b88bbe7e178a001e9420de Mon Sep 17 00:00:00 2001 From: mariuszs Date: Wed, 8 Apr 2026 17:21:43 +0200 Subject: [PATCH 3/7] fix(mvn): remove WARNING from test keep filter, avoid false positives MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Real-world Maven test logs (3381 lines from Spring Boot + Testcontainers project) showed [WARNING] matches 2296 lines of dependency model and Liquibase noise. Remove WARNING from keep filter — test failures are always [ERROR]. Also tighten Exception pattern to avoid false positives on class names like DOMException or ExceptionHandler. Result: 3381 lines → 3 lines (99.9% savings) on real project log. Add inline test with real project failure data. --- src/filters/mvn-test.toml | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/filters/mvn-test.toml b/src/filters/mvn-test.toml index c86e2af46..197ecbd07 100644 --- a/src/filters/mvn-test.toml +++ b/src/filters/mvn-test.toml @@ -15,14 +15,16 @@ replace = [ ] keep_lines_matching = [ "\\[ERROR\\]", - "\\[WARNING\\]", "BUILD (SUCCESS|FAILURE)", "Tests run:", "<<< FAILURE", "<<< ERROR", "^\\s+at\\s", "Caused by:", - "Exception", + "^java\\.lang\\.\\w*Exception", + "^java\\.lang\\.\\w*Error", + "^org\\.junit\\..*Exception", + "^org\\.opentest4j\\.", "expected:", "but was:", "Expected", @@ -68,7 +70,7 @@ Expected size: 1 but was: 3 [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException """ -expected = "[ERROR] Tests run: 27, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.073 s <<< FAILURE! -- in io.github.mavenmcp.parser.DependencyTreeParserTest\n[ERROR] io.github.mavenmcp.parser.DependencyTreeParserTest.shouldMatchCaseInsensitively -- Time elapsed: 0.004 s <<< FAILURE!\nExpected size: 1 but was: 3\n[INFO] BUILD FAILURE\n[INFO] Total time: 0.611 s\n[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.4:test (default-test) on project maven-mcp: There are test failures." +expected = "[ERROR] Tests run: 27, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.073 s <<< FAILURE! -- in io.github.mavenmcp.parser.DependencyTreeParserTest\n[ERROR] io.github.mavenmcp.parser.DependencyTreeParserTest.shouldMatchCaseInsensitively -- Time elapsed: 0.004 s <<< FAILURE!\njava.lang.AssertionError:\nExpected size: 1 but was: 3\n[INFO] BUILD FAILURE\n[INFO] Total time: 0.611 s\n[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.4:test (default-test) on project maven-mcp: There are test failures." [[tests.mvn-test]] name = "multiple test failures with assertion details" @@ -92,3 +94,29 @@ expected: "com.example" [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException """ expected = "[ERROR] DependencyTreeParserTest.shouldParseDirectDependency:35\nexpected: \"org.slf4j\"\n but was: \"com.google.guava\"\n[ERROR] DependencyTreeParserTest.shouldParseSimpleTree:22\nexpected: \"com.example\"\n but was: \"org.slf4j\"\n[ERROR] Tests run: 17, Failures: 7, Errors: 0, Skipped: 0\n[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.4:test (default-test) on project maven-mcp: There are test failures." + +[[tests.mvn-test]] +name = "real project build failure strips noise" +input = """ +[INFO] Loaded 22505 auto-discovered prefixes for remote repository central +[INFO] Scanning for projects... +[WARNING] Could not transfer metadata from shibboleth-releases +[WARNING] 176 problems were encountered while building the effective model +[WARNING] 130 problems were encountered while building the effective model +[INFO] Building auth 1.3-SNAPSHOT +[INFO] --- jacoco:0.8.14:prepare-agent (prepare-agent) --- +[INFO] Testcontainers version: 2.0.4 +[INFO] Found Docker environment with local Unix socket +[INFO] npm warn deprecated domexception@2.0.1: Use your platform's native DOMException instead +[INFO] Parsing 'com.devskiller.auth.GlobalControllerExceptionHandler$VndErrors' +[INFO] BUILD FAILURE +[INFO] Total time: 37.404 s +[ERROR] Failed to execute goal cz.habarta.typescript-generator:typescript-generator-maven-plugin:3.2.1263:generate (Generate boost.d.ts) on project auth: Execution failed: Cannot read the array length because "array" is null -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch +[ERROR] Re-run Maven using the -X switch to enable verbose output +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException +""" +expected = "[INFO] BUILD FAILURE\n[INFO] Total time: 37.404 s\n[ERROR] Failed to execute goal cz.habarta.typescript-generator:typescript-generator-maven-plugin:3.2.1263:generate (Generate boost.d.ts) on project auth: Execution failed: Cannot read the array length because \"array\" is null -> [Help 1]" From 07e64621880bbe21bd123dfb3f44f92ed6099646 Mon Sep 17 00:00:00 2001 From: mariuszs Date: Wed, 8 Apr 2026 17:25:52 +0200 Subject: [PATCH 4/7] feat(mvn): add match_output short-circuit for successful test runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Real-world success log (10380 lines, 954 tests) showed 165 lines matched by keep filter — too noisy for a green build. Add match_output with unless guard: if output contains "Tests run: N, Failures: 0, Errors: 0" and no [ERROR]/FAILURE, short-circuit to one-liner summary. Result: 10380 lines → 1 line ("mvn test: ok") on success. Failure logs still show full error details (unless guard skips rule). --- src/filters/mvn-test.toml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/filters/mvn-test.toml b/src/filters/mvn-test.toml index 197ecbd07..dff9194af 100644 --- a/src/filters/mvn-test.toml +++ b/src/filters/mvn-test.toml @@ -2,6 +2,10 @@ description = "Compact Maven test output — failures only, strip surefire boilerplate" match_command = "^(\\.?\\/?)mvnw?\\s+test\\b" strip_ansi = true +# Stage 3: short-circuit on full success (no errors/failures anywhere) +match_output = [ + { pattern = "Tests run: (\\d+), Failures: 0, Errors: 0", message = "mvn test: ok (all tests passed)", unless = "<<< FAILURE|\\[ERROR\\]" }, +] # Stage 2: blank out Maven surefire boilerplate before keep filter replace = [ { pattern = "^\\[ERROR\\]\\s*$", replacement = "" }, @@ -46,6 +50,20 @@ input = """ """ expected = "[INFO] BUILD SUCCESS\n[INFO] Total time: 3.456 s" +[[tests.mvn-test]] +name = "954 tests pass returns short summary" +input = """ +[INFO] Scanning for projects... +[INFO] Building auth 1.3-SNAPSHOT +[INFO] --- maven-surefire-plugin:3.5.4:test (default-test) --- +[INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.010 s -- in com.example.PermissionHelperTest +[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.073 s -- in com.example.SampleTest +[INFO] Tests run: 954, Failures: 0, Errors: 0, Skipped: 9 +[INFO] BUILD SUCCESS +[INFO] Total time: 01:46 min +""" +expected = "mvn test: ok (all tests passed)" + [[tests.mvn-test]] name = "test failure preserves error details and strips boilerplate" input = """ From c8abf845e0356d7a46aa55b3dd3877ab89240ee7 Mon Sep 17 00:00:00 2001 From: mariuszs Date: Wed, 8 Apr 2026 17:31:42 +0200 Subject: [PATCH 5/7] fix(mvn): strip framework stack frames from test failure output Real-world log (3343 lines, ClassNotFoundException during test discovery) showed ~90 lines of Maven/JUnit/Surefire/JDK framework stack frames. Strip these via replace rules, keeping only application-relevant frames. Stripped: org.apache.maven.*, org.junit.platform.*, org.codehaus.plexus.*, java.base/*, "... N more" suffixes. --- src/filters/mvn-test.toml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/filters/mvn-test.toml b/src/filters/mvn-test.toml index dff9194af..485021d12 100644 --- a/src/filters/mvn-test.toml +++ b/src/filters/mvn-test.toml @@ -6,7 +6,7 @@ strip_ansi = true match_output = [ { pattern = "Tests run: (\\d+), Failures: 0, Errors: 0", message = "mvn test: ok (all tests passed)", unless = "<<< FAILURE|\\[ERROR\\]" }, ] -# Stage 2: blank out Maven surefire boilerplate before keep filter +# Stage 2: blank out Maven surefire boilerplate and framework stack frames replace = [ { pattern = "^\\[ERROR\\]\\s*$", replacement = "" }, { pattern = "^\\[ERROR\\] -> \\[Help.*", replacement = "" }, @@ -16,6 +16,12 @@ replace = [ { pattern = "^\\[ERROR\\] To see the full stack trace.*", replacement = "" }, { pattern = "^\\[ERROR\\] Re-run Maven.*", replacement = "" }, { pattern = "^\\[ERROR\\] For more information about.*", replacement = "" }, + # Strip framework stack frames (Maven, JUnit platform, Surefire, classworlds, JDK internals) + { pattern = "^\\[ERROR\\]\\s+at org\\.apache\\.maven\\..*", replacement = "" }, + { pattern = "^\\[ERROR\\]\\s+at org\\.junit\\.platform\\..*", replacement = "" }, + { pattern = "^\\[ERROR\\]\\s+at org\\.codehaus\\.plexus\\..*", replacement = "" }, + { pattern = "^\\[ERROR\\]\\s+at java\\.base/.*", replacement = "" }, + { pattern = "^\\[ERROR\\]\\s+\\.\\.\\. \\d+ more$", replacement = "" }, ] keep_lines_matching = [ "\\[ERROR\\]", From b9e2bff3fd7ef4bfa0e3eb71d7145d2c7e2f06cc Mon Sep 17 00:00:00 2001 From: mariuszs Date: Wed, 8 Apr 2026 17:42:36 +0200 Subject: [PATCH 6/7] fix(mvn): use tail_lines to capture Maven summary, avoid repeated stack traces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Real-world log with 9 identical stack traces (UrlWhitelistChecker compilation errors) showed 75 filtered lines, mostly repetition. Use tail_lines=25 to capture Maven's own deduplicated summary section at the end of output — includes failure list, assertion details, test count, BUILD status, and Total time. Result: 3279 lines → 25 lines (99.2% savings), zero repetition. --- src/filters/mvn-test.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/filters/mvn-test.toml b/src/filters/mvn-test.toml index 485021d12..ba35578bc 100644 --- a/src/filters/mvn-test.toml +++ b/src/filters/mvn-test.toml @@ -40,7 +40,8 @@ keep_lines_matching = [ "Expected", "Total time:", ] -max_lines = 50 +tail_lines = 25 +max_lines = 25 on_empty = "mvn test: ok (all tests passed)" [[tests.mvn-test]] From b2119f2442811d610976a9a0ff54f637fb3038cf Mon Sep 17 00:00:00 2001 From: mariuszs Date: Wed, 8 Apr 2026 17:44:20 +0200 Subject: [PATCH 7/7] fix(mvn): relax tail_lines from 25 to 40 for more context --- src/filters/mvn-test.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/filters/mvn-test.toml b/src/filters/mvn-test.toml index ba35578bc..a755c318f 100644 --- a/src/filters/mvn-test.toml +++ b/src/filters/mvn-test.toml @@ -40,8 +40,8 @@ keep_lines_matching = [ "Expected", "Total time:", ] -tail_lines = 25 -max_lines = 25 +tail_lines = 40 +max_lines = 40 on_empty = "mvn test: ok (all tests passed)" [[tests.mvn-test]]