You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/07/24 22:59:18 UTC
[PR] Enable Maven 4 build and fix IT failures [maven-surefire]
gnodet opened a new pull request, #3402:
URL: https://github.com/apache/maven-surefire/pull/3402
## Summary
- Enable Maven 4 in the CI matrix (`maven4-enabled: true`) with proper JDK 11 exclusion
- Fix integration test failures caused by `maven-verifier:2.0.0-M1` API incompatibility with Maven 4
- Fix pre-existing race condition in `CountdownCloseable`
## Details
### Maven 4 CI matrix
The shared workflow's matrix uses the exact version string `4.0.0-rc-5`, so the exclude must match it exactly (not just `"4"`). JDK 8 is already auto-excluded by the shared workflow when `maven4-enabled=true`.
### IT failures — maven-verifier embedded mode
All integration tests fail with Maven 4 because `maven-verifier:2.0.0-M1` uses reflection to call `MavenCling.doMain(String[], String, PrintStream, PrintStream)` in embedded mode, but Maven 4 rc-5 changed this method signature. The fix detects Maven 4 by checking for `maven-cling-*.jar` in the Maven home lib directory and forces forked JVM mode, bypassing the broken reflection entirely.
This is a **short-term workaround**. The long-term fix is to migrate from `maven-verifier` (which is [being deprecated](https://github.com/apache/maven-verifier/issues/186)) to [maven-executor](https://github.com/apache/maven-executor) (`org.apache.maven.executor:maven-executor:1.0.0`), which natively supports both Maven 3.x and 4.x.
### CountdownCloseable race condition
`CountdownCloseable.awaitClosed()` used `if` instead of `while` to guard `Object.wait()`, making it vulnerable to spurious wakeups per the Java Language Specification. This is a pre-existing bug unrelated to Maven 4, but it could cause intermittent `CommandlineExecutorTest` failures under different JVM timing.
## Related
- Supersedes / addresses the same goals as #3352
- Upstream: [apache/maven-verifier#186](https://github.com/apache/maven-verifier/issues/186) (deprecation)
- Upstream: [apache/maven-executor](https://github.com/apache/maven-executor) (replacement)
## Test plan
- [x] `surefire-extensions-api` unit tests pass locally (including `CommandlineExecutorTest`)
- [x] Full project builds successfully (`mvn clean install -DskipTests`)
- [ ] CI: Maven 3.9.x cells should continue to pass (no behavior change)
- [ ] CI: Maven 4 + JDK 17/21 cells should now pass with forked mode
- [ ] CI: Maven 4 + JDK 8/11 cells should be excluded from the matrix
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Enable Maven 4 build and fix IT failures [maven-surefire]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet closed pull request #3402: Enable Maven 4 build and fix IT failures
URL: https://github.com/apache/maven-surefire/pull/3402
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Enable Maven 4 build and fix IT failures [maven-surefire]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #3402:
URL: https://github.com/apache/maven-surefire/pull/3402#issuecomment-5075317066
Closing in favor of pushing directly to #3352's branch.
--
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: issues-unsubscribe@maven.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org