Repository navigation
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. Backport from master c1de267
Member
Author
|
This is a backport to 4.0.x of forward port to master from 3.10.x 😄 |
cstamas
marked this pull request as ready for review
June 22, 2026 09:02
ascheman
added a commit
to aschemaven/maven
that referenced
this pull request
Sep 7, 2026
resolveCoreExtensionAndFlatten and resolvePluginAndFlatten were added as abstract methods in 4.0.0-rc-6, forward-porting the Maven 3.10.0 changes (apache#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. Closes apache#13068 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01W2HnhKt7MJWYsSSVUmPrvU
ascheman
added a commit
to aschemaven/maven
that referenced
this pull request
Sep 7, 2026
resolveCoreExtensionAndFlatten and resolvePluginAndFlatten were added as abstract methods in 4.0.0-rc-6, forward-porting the Maven 3.10.0 changes (apache#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. Closes apache#13068 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01W2HnhKt7MJWYsSSVUmPrvU
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. Closes #13068 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01W2HnhKt7MJWYsSSVUmPrvU
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.
Backport from master c1de267