Skip to content

Maven 4.0.0-rc-4 fails dependency resolution if distributionManagement is defined in parent #11021

@dmitry-lt

Description

@dmitry-lt

Affected version

4.0.0-rc-4

Bug description

Using the Maven 4.0.0-rc-4 wrapper, create a project with a pom.xml containing:

<parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>35</version>
</parent>

and

<dependencies>
    <dependency>
        <groupId>org.apache.hadoop</groupId>
        <artifactId>hadoop-client</artifactId>
        <version>3.4.1</version>
    </dependency>
</dependencies>

Run ./mvnw validate

Expected
The project validates successfully (as it does when using Maven 3.9.11 or 4.0.0-rc-3).

Actual
The validation fails with:
Could not collect dependencies for project org.example:untitled17:jar:1.0-SNAPSHOT
[ERROR] java.lang.IllegalArgumentException: Invalid Version Range Request: org.apache:apache:pom:21 < [central (https://repo.maven.apache.org/maven2, default, releases), apache.snapshots.https (https://repository.apache.org/content/repositories/snapshots, default, releases+snapshots), repository.jboss.org (https://repository.jboss.org/nexus/content/groups/public/, default, releases), ${distMgmtSnapshotsId} (${distMgmtSnapshotsUrl}, default, releases+snapshots)]

Reproducer
Reproducer project attached: untitled17.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions