gnodet opened a new pull request, #3448:
URL: https://github.com/apache/maven-surefire/pull/3448

   ## Summary
   
   Re-rolls Guillaume's Maven 4 IT workaround as a standalone PR against master 
so it can't get lost in future rebases of #3352.
   
   - **Force forked JVM for Maven 4:** `maven-verifier 2.0.0-M1`'s embedded 
mode reflects on `MavenCli.doMain(...)`, which Maven 4 replaced with 
`MavenCling` (incompatible signature → `NoSuchMethodException` → 437 IT 
failures). `MavenLauncher` now detects Maven 4 by checking for 
`maven-cli-*.jar` in `$MAVEN_HOME/lib/` and forces `forkJvm=true`, bypassing 
the broken reflection entirely.
   - **Fix `CountdownCloseable` spurious wakeup:** `awaitClosed()` used `if` 
instead of `while` to guard `Object.wait()`, violating the JLS contract. Could 
explain intermittent `CommandlineExecutorTest` failures.
   
   This is a **short-term workaround**. The long-term fix is migrating from the 
deprecated `maven-verifier` to 
[`maven-executor`](https://github.com/apache/maven-executor) which natively 
supports both Maven 3.x and 4.x (apache/maven-verifier#186).
   
   Context: 
https://github.com/apache/maven-surefire/pull/3352#issuecomment-5245583078
   
   ## Test plan
   
   - [ ] Maven 3 ITs remain unaffected (`isMaven4()` returns `false`, `forkJvm` 
stays `false`)
   - [ ] Maven 4 ITs no longer fail with `NoSuchMethodException` (forked mode 
bypasses embedded reflection)
   - [ ] `CountdownCloseable.awaitClosed()` is robust against JLS spurious 
wakeups
   
   🤖 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to