Support Maven version ranges in profile activation - #12767
Open
goutamadwant wants to merge 1 commit into
Open
Conversation
Recognize version ranges for the existing maven.version activation property without changing the POM model. Preserve exact matching for other values and report malformed ranges as warnings.\n\nCover bounded, open-ended, negated, and malformed ranges, including activation through the model builder.
gnodet
added a commit
to gnodet/maven
that referenced
this pull request
Aug 19, 2026
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.
Addresses #11694.
Support Maven version ranges through the existing
maven.versionprofileactivation property on
master, without adding a POM model element.The implementation recognizes range syntax only for
maven.versionandevaluates it with the existing
ModelVersionParser. Exact matching remainsunchanged for ordinary values and all other properties. Bounded, open-ended,
and negated ranges are supported; malformed ranges fail closed with a model
warning.
Tests cover the suggested
[4.0.0,)form, prerelease and boundary behavior,negation, malformed input, unchanged literal matching, and activation through
the model builder.
This implements the
masterpath. Please consider a backport tomaven-4.0.x. Maven 3 requires a separatemaven-3.10.ximplementation usingits legacy model builder and version APIs.
Tests:
mvn -pl impl/maven-impl verify(560 tests passed, 4 skipped)Full reactor and all 1,051 Core ITs executed
Targeted Java 21 rerun of the affected IT classes (4 tests passed)
Your pull request should address just one issue, without pulling in other changes.
Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
Each commit in the pull request should have a meaningful subject line and body.
Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
Run
mvn verifyto make sure basic checks pass.You have run the Core IT successfully. See the test details above.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004.
In any other case, please file an Apache Individual Contributor License Agreement.