Use a MojoExecutionException constructor that exists in Maven 3.6.3 - #1684
Merged
Conversation
MojoExecutionException(Throwable) arrived in Maven 3.9.0, so on the version <prerequisites> declares this branch raised NoSuchMethodError instead of the exception it meant to throw. Do not collapse it back to the single-argument form while the declared prerequisite is still 3.6.3. The message follows the sibling catch a few lines below, which already names the file it failed on. Verified: mvn -DmavenVersion=3.6.3 clean test-compile -> BUILD SUCCESS, and fails to compile without this change. Fixes #1682 Generated-by: Claude Opus 5 (1M context)
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.
MojoExecutionException(Throwable)arrived in Maven 3.9.0, so on the version<prerequisites>declares,
RenderDependenciesMojo.storeraisedNoSuchMethodErrorinstead of the exception itmeant to throw. The reference is in released bytecode for 3.9.0, 3.10.0 and 3.11.0, not just in
source.
The message follows the sibling
catcha few lines below rather than the baree.getMessage()the issue sketched, so the failure names the directory it could not create.
No unit test accompanies this
Not an omission. Compiled against the current
<mavenVersion>(3.9.16) the constructor exists,so any test of this branch passes with or without the fix. The only check that fails without it
is compiling against the baseline itself:
That check is #1683, which is red today for precisely this reason and goes green once this lands.
Merge this first — landing the guard first would turn master red.
Fixes #1682
Drafted with Claude — please verify