Skip to content

feat(mvn): add Maven wrapper (mvnw) support and test goal#1

Open
mariuszs wants to merge 7 commits intomasterfrom
feat/maven-wrapper-support
Open

feat(mvn): add Maven wrapper (mvnw) support and test goal#1
mariuszs wants to merge 7 commits intomasterfrom
feat/maven-wrapper-support

Conversation

@mariuszs
Copy link
Copy Markdown
Owner

@mariuszs mariuszs commented Apr 8, 2026

Summary

  • Add ./mvnw and mvnw support to Maven TOML filter and rewrite rules (same pattern as Gradle wrapper)
  • Add missing test goal to Maven filter — mvn test was not being filtered
  • Extend strip patterns with real Maven noise lines (Scanning, Compiling, Recompiling, [Help] boilerplate)
  • Update spring-boot.toml to also match mvnw spring-boot:run and gradlew bootRun

Test plan

  • cargo run -- verify --filter mvn-build — 8/8 inline TOML tests pass
  • cargo test --all — 1350 tests pass
  • cargo fmt --all --check — clean
  • Manual: rtk mvnw clean install on a real Maven project
  • Manual: rtk ./mvnw test on a real Maven project

mariuszs added 7 commits April 8, 2026 16:56
- 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
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
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.
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).
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.
…ck traces

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant