Repository navigation
Forward port Maven 3.10.0 PluginDependenciesResolver changes - #12329
Merged
Merged
Conversation
Also, restore binary compatibility that was broken in 4-beta-2. This PR aligns PluginDependenciesResolver with changes happened in Maven 3.10.x, and also restores binary incompatibility happened in DefaultPluginDependenciesResolver that used to be injected directly.
cstamas
marked this pull request as ready for review
June 19, 2026 11:23
Member
Author
|
@gnodet master is broken with this same error |
gnodet
reviewed
Jun 19, 2026
gnodet
left a comment
Contributor
There was a problem hiding this comment.
Nice work aligning the Maven 4.x PluginDependenciesResolver with the 3.10.x changes and restoring the binary compatibility broken in 4-beta-2. The deprecation+delegation pattern is correctly applied, and switching to interface-based injection in BootstrapCoreExtensionManager is the right move.
A couple more observations not tied to specific lines:
- TODO comment: Both
BootstrapCoreExtensionManagerfiles (compat and impl) have a TODO comment above the call site that still referencesresolveCoreExtension. Since the method is nowresolveCoreExtensionAndFlattenand the method is now on the interface, the TODO may be partially addressed and could be refined. @since 3.10.0on new interface methods: The new methods use@since 3.10.0, which correctly references where they originated, but since Maven 4.x and 3.10.x are separate release lines, consumers reading the Maven 4.x javadoc might find this confusing. Flagging for awareness only.- No tests added: No new or modified tests, which is reasonable for an interface evolution / binary compat PR where the behavior is unchanged (new methods delegate to the same
resolveInternallogic).
This review does not replace specialized AI review tools (CodeRabbit, Sourcery) or static analysis (SonarCloud).
Fully automatic review from Claude Code
| * @param session The repository session to use for resolving the plugin artifacts, must not be {@code null}. | ||
| * @return The dependency resolution result having the resolved extension class path but also the tree, never {@code null}. | ||
| * @throws PluginResolutionException If any dependency could not be resolved. | ||
| * @since 3.10.0 |
Member
There was a problem hiding this comment.
maybe we can also add a 4.x version here, or use only 4.x as @gnodet mention
slawekjaranowski
approved these changes
Jun 21, 2026
This was referenced Sep 7, 2026
ascheman
added a commit
that referenced
this pull request
Sep 8, 2026
resolveCoreExtensionAndFlatten and resolvePluginAndFlatten were added as abstract methods in 4.0.0-rc-6, forward-porting the Maven 3.10.0 changes (#12335). The interface is documented as internal, but it is the only hook Maven offers for influencing plugin resolution, and every major Java IDE overrides it: IntelliJ IDEA, Eclipse m2e and NetBeans. Those implementations live out of tree and are compiled against one Maven while running on another, so adding abstract methods turns plugin resolution into an AbstractMethodError. Both methods now default to the pre-existing resolvePlugin, which DefaultPluginDependenciesResolver already treats as an alias -- there, resolvePlugin delegates to resolvePluginAndFlatten. resolvePlugin itself deliberately stays abstract: a default there would let an implementation overriding neither method recurse infinitely. The default for resolveCoreExtensionAndFlatten is best effort. A dedicated implementation additionally reads the extension's artifact descriptor to apply relocations and run MavenPluginDependenciesValidator. Verified against the class shipped in IntelliJ IDEA 2026.2.2, which implements resolvePluginAndFlatten but not resolveCoreExtensionAndFlatten and therefore still fails on stock rc-6. Adds a unit test pinning the compatibility contract and a core IT that builds an extension against maven-core 4.0.0-rc-5 -- the last release before the methods existed -- and runs a build through it. Verified by Christofer Dutz (@chrisdutz) on Apache PLC4X: a build carrying this change imports cleanly in IntelliJ IDEA, where stock rc-6 fails. Forward port of 349395c from maven-4.0.x. The breaking change was ported to both lines (#12329 master, #12335 maven-4.0.x); the fix so far only to maven-4.0.x, so 4.1.0 would reintroduce the regression. Two adjustments were needed for master, both in the IT only: - no TestSuiteOrdering entry: that class now orders by name pattern (MavenITgh<number>) instead of keeping an explicit list - the IT harness moved on: AbstractMavenIntegrationTestCase no longer takes a version range, extractResources returns Path, and newVerifier(String) is deprecated in favour of newVerifier(Path) The production change and the unit test are byte-identical to maven-4.0.x. Closes #13068 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01W2HnhKt7MJWYsSSVUmPrvU
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.
Also, restore binary compatibility that was broken in 4-beta-2.
This PR aligns PluginDependenciesResolver with changes happened in Maven 3.10.x, and also restores binary incompatibility happened in DefaultPluginDependenciesResolver that used to be injected directly.