apache/maven · error · UnresolvableModelException

The requested parent version range '%s' does not specify an

Error message

The requested parent version range '%s' does not specify an upper bound

What it means

Maven deliberately forbids open-ended parent version ranges (MNG-2199): when the resolved range has no upper bound, e.g. [1.0,), DefaultModelResolver throws UnresolvableModelException even though matching versions exist, because an unbounded parent would make builds non-reproducible. The exact message is asserted by the MNG-2199 core integration test.

Source

Thrown at compat/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultModelResolver.java:194

            versionRangeRequest.setTrace(trace);

            final VersionRangeResult versionRangeResult =
                    versionRangeResolver.resolveVersionRange(session, versionRangeRequest);

            if (versionRangeResult.getHighestVersion() == null) {
                throw new UnresolvableModelException(
                        String.format(
                                "No versions matched the requested parent version range '%s'", parent.getVersion()),
                        parent.getGroupId(),
                        parent.getArtifactId(),
                        parent.getVersion());
            }

            if (versionRangeResult.getVersionConstraint() != null
                    && versionRangeResult.getVersionConstraint().getRange() != null
                    && versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null) {
                // Message below is checked for in the MNG-2199 core IT.
                throw new UnresolvableModelException(
                        String.format(
                                "The requested parent version range '%s' does not specify an upper bound",
                                parent.getVersion()),
                        parent.getGroupId(),
                        parent.getArtifactId(),
                        parent.getVersion());
            }

            parent.setVersion(versionRangeResult.getHighestVersion().toString());

            return resolveModel(parent.getGroupId(), parent.getArtifactId(), parent.getVersion());
        } catch (final VersionRangeResolutionException e) {
            throw new UnresolvableModelException(
                    e.getMessage(), parent.getGroupId(), parent.getArtifactId(), parent.getVersion(), e);
        }
    }

    @Override

View on GitHub (pinned to e4093d4e12)

Solutions

  1. Give the range an upper bound, e.g. [1.0,2.0)
  2. Prefer a concrete parent version: parent ranges are only partially supported and discouraged
  3. Use versions-maven-plugin (display-parent-updates, set-parent) to manage parent version bumps instead of ranges
  4. Add a lint check in CI rejecting open-ended ranges inside <parent>

Example fix

<!-- before: open-ended parent range (rejected even when versions match) -->
<parent>
  <groupId>com.example</groupId>
  <artifactId>platform</artifactId>
  <version>[2.0,)</version>
</parent>

<!-- after: bounded range or concrete version -->
<parent>
  <groupId>com.example</groupId>
  <artifactId>platform</artifactId>
  <version>[2.0,3.0)</version>
</parent>
Defensive patterns

Strategy: validation

Validate before calling

// Reject open-ended parent ranges before building
VersionRange range = VersionRange.createFromVersionSpec(parent.getVersion()); // parse first
if (!hasUpperBound(range)) {
    throw new IllegalArgumentException(
        "Parent version range needs an upper bound: " + parent.getVersion());
}

Type guard

static boolean hasUpperBound(VersionRange r) {
    return r.getRestrictions().stream().anyMatch(x -> x.getUpperBound() != null);
}

Prevention

When it happens

Trigger: <parent><version>[1.0,)</version></parent> or any range whose computed upper bound is null; the version-range resolver succeeded and matched versions, but the constraint check rejects the unbounded range.

Common situations: Developers attempting 'always latest parent' semantics; ranges copied from dependency management (where they are legal) into the parent element; CI suddenly failing after a previously concrete parent version was switched to a range.

Related errors


AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21). Data as JSON: /api/errors/21aa0146b57c01eb. Report an issue: GitHub.