Fix #12983: ToolchainPluginStrategy handles inherited source levels - #12992
Closed
gnodet wants to merge 1 commit into
Closed
Fix #12983: ToolchainPluginStrategy handles inherited source levels#12992gnodet wants to merge 1 commit into
gnodet wants to merge 1 commit into
Conversation
…rom parent POMs When maven.compiler.source/target is inherited from a parent POM (e.g., geronimo-genesis sets source=1.5), mvnup now resolves the effective source level using Maven's model builder and configures the auto-toolchain for JDK 8/11 compilation. Previously it only inspected the local POM. The fix adds a fallback path in doApply: when the fast DOM-based detection finds no source level in the local POM, it builds the effective model to resolve inherited properties. This handles the 12 Apache projects that fail with "Source option N is no longer supported" under Maven 4. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
Closing as duplicate of #12973, which fixes the same issue (inherited source level detection in ToolchainPluginStrategy) and also includes session caching improvements via MvnupSessionHolder and RequestCache deduplication. |
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
ToolchainPluginStrategyfinds no source level in the local POM DOMmaven.compiler.source/targetis inherited from a parent POM (e.g.,geronimo-genesissetssource=1.5),mvnupnow resolves the effective source level viabuildEffectiveModel()and configures the auto-toolchain for JDK 8/11 compilation"Source option N is no longer supported"under Maven 4Design
The fix follows the same pattern used by
CompatibilityFixStrategy.collectEffectiveProperties():maven.compiler.release,maven.compiler.source, or compiler plugin configmaven.compiler.releaseandmaven.compiler.sourcefrom the effective propertiesTest plan
detectSourceLevelFromEffectiveModel()(6 tests): release property, source property, precedence, legacy 1.x format, empty properties, no compiler propertiesdoApply()with inherited source levels (5 tests): plugin added for inherited incompatible source, no modification for compatible inherited source, graceful fallback on resolution failure, local takes precedence over effective, correct JDK constraint (source 6 → JDK 11)🤖 Generated with Claude Code