Repository navigation
Conversation
…ious wakeup maven-verifier 2.0.0-M1's embedded mode uses reflection to call MavenCli.doMain(), but Maven 4 replaced that class with MavenCling which has an incompatible method signature, causing all ITs to fail with NoSuchMethodException when run against Maven 4. Add isMaven4() detection in MavenLauncher that checks for maven-cli-*.jar in $MAVEN_HOME/lib/ (a Maven 4-only artifact) and forces forkJvm=true, bypassing the broken reflection path. This is a short-term workaround until surefire migrates from maven-verifier to maven-executor (apache/maven-verifier#186). Also fix a pre-existing race condition in CountdownCloseable where awaitClosed() used 'if' instead of 'while' to guard Object.wait(), making it vulnerable to spurious wakeups per the JLS. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
elharo
approved these changes
Sep 2, 2026
Member
|
#3484 replaces the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
maven-verifier 2.0.0-M1's embedded mode reflects onMavenCli.doMain(...), which Maven 4 replaced withMavenCling(incompatible signature →NoSuchMethodException→ 437 IT failures).MavenLaunchernow detects Maven 4 by checking formaven-cli-*.jarin$MAVEN_HOME/lib/and forcesforkJvm=true, bypassing the broken reflection entirely.CountdownCloseablespurious wakeup:awaitClosed()usedifinstead ofwhileto guardObject.wait(), violating the JLS contract. Could explain intermittentCommandlineExecutorTestfailures.This is a short-term workaround. The long-term fix is migrating from the deprecated
maven-verifiertomaven-executorwhich natively supports both Maven 3.x and 4.x (apache/maven-verifier#186).Context: #3352 (comment)
Test plan
isMaven4()returnsfalse,forkJvmstaysfalse)NoSuchMethodException(forked mode bypasses embedded reflection)CountdownCloseable.awaitClosed()is robust against JLS spurious wakeups🤖 Generated with Claude Code