apache/maven · warning · InvalidVersionSpecificationException
Unbounded range: {}
Error message
Unbounded range: {} What it means
The invoked CLI option is annotated as deprecated in CLIManager (for example -llr for Maven 2 legacy local repository behavior, or the -gs/-gt alternate-path options). Maven prints the flag with its since-version and reason; when the deprecation description starts with 'UNSUPPORTED:' the message is upgraded to an error and Maven exits with code 1 via ExitException.
Source
Thrown at compat/maven-artifact/src/main/java/org/apache/maven/artifact/versioning/VersionRange.java:123
List<Restriction> restrictions = new ArrayList<>();
String process = spec;
ArtifactVersion version = null;
ArtifactVersion upperBound = null;
ArtifactVersion lowerBound = null;
while (process.startsWith("[") || process.startsWith("(")) {
int index1 = process.indexOf(')');
int index2 = process.indexOf(']');
int index = index2;
if (index2 < 0 || index1 < index2) {
if (index1 >= 0) {
index = index1;
}
}
if (index < 0) {
throw new InvalidVersionSpecificationException("Unbounded range: " + spec);
}
Restriction restriction = parseRestriction(process.substring(0, index + 1));
if (lowerBound == null) {
lowerBound = restriction.getLowerBound();
}
if (upperBound != null) {
if (restriction.getLowerBound() == null
|| restriction.getLowerBound().compareTo(upperBound) < 0) {
throw new InvalidVersionSpecificationException("Ranges overlap: " + spec);
}
}
restrictions.add(restriction);
upperBound = restriction.getUpperBound();
process = process.substring(index + 1).trim();
if (process.startsWith(",")) {View on GitHub (pinned to e4093d4e12)
Solutions
- Drop the flag from scripts; mvn -h lists current deprecations and their replacements
- Adopt the supported replacement named in the deprecation description
- Temporarily pin the previous Maven version via the wrapper while migrating scripts
- Grep CI pipelines for the deprecated flag so upgrades fail fast instead of at build time
Example fix
# before mvn -llr clean install # after: deprecated Maven 2 legacy local repository flag removed mvn clean install
Defensive patterns
Strategy: validation
Validate before calling
# review current deprecations and cross-check your CI scripts before upgrading Maven mvn -h 2>&1 | grep -i -B1 -A1 deprecated
Prevention
- Run mvn -h after each Maven upgrade and diff against the flags used in your scripts
- Centralize Maven invocations in one shared CI script so flags are upgraded once
- Watch Maven release notes for options marked UNSUPPORTED, which hard-fail the build
When it happens
Trigger: Passing a deprecated flag on the command line; the check runs over every option present in the parsed command line before the build starts.
Common situations: CI scripts pinned to old Maven versions run against a newer Maven; wrapper distributions upgraded without updating pipelines; copy-pasted mvn invocations carrying legacy flags.
Related errors
- Ranges overlap: {}
- Range defies version ordering: {}
- The version cannot be empty.
- Only fully-qualified sets allowed in multiple set scenario:
- Single version must be surrounded by []: {}
AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21).
Data as JSON: /api/errors/02a7df383c1d4bee.
Report an issue: GitHub.