Apache Software Foundation / Maven Core
Merged upstreamFeatureMerged Aug 26, 2026

Support Maven version ranges in profile activation

Extended Maven profile activation so the existing `maven.version` property accepts version ranges without adding a new POM model element.

apache/maven · #12767

Build configuration feature

Maven profiles can now target bounded, open-ended, or negated Maven version ranges through `maven.version` activation.

Problem

Projects could activate profiles only by exact Maven version values, making compatibility profiles brittle across releases and preventing expressions such as `[4.0.0,)` from selecting an intended Maven generation.

Approach

Recognized range syntax specifically for `maven.version` and evaluated it with Maven's existing `ModelVersionParser`. Exact matching remains unchanged elsewhere, while malformed ranges fail closed with a model warning.

Impact and scope

  • Lets builds express minimum, maximum, bounded, and excluded Maven compatibility ranges declaratively.
  • Avoids a POM schema change by extending the existing activation property with project-native version parsing.
  • Preserves literal matching for ordinary properties and handles malformed configuration conservatively.

Validation

  • Covered bounded, open-ended, negated, prerelease, boundary, malformed, and unchanged literal matching cases.
  • Verified activation through the model builder, 560 implementation tests, the full reactor, and 1,051 Core IT executions.
  • Received three maintainer approvals; the authored merge commit is GitHub-verified and GH-11694 closed as completed.