Skip to content

Support Maven version ranges in profile activation - #12767

Open
goutamadwant wants to merge 1 commit into
apache:masterfrom
goutamadwant:support-maven-version-range-activation
Open

Support Maven version ranges in profile activation#12767
goutamadwant wants to merge 1 commit into
apache:masterfrom
goutamadwant:support-maven-version-range-activation

Conversation

@goutamadwant

Copy link
Copy Markdown

Addresses #11694.

Support Maven version ranges through the existing maven.version profile
activation property on master, without adding a POM model element.

The implementation recognizes range syntax only for maven.version and
evaluates it with the existing ModelVersionParser. Exact matching remains
unchanged 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 master path. Please consider a backport to
maven-4.0.x. Maven 3 requires a separate maven-3.10.x implementation using
its 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 verify to 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant