Skip to content

[MNG-5527] Dependency management import should support relocations. #6804

Open

Description

@jira-importer

Matous Jobanek opened MNG-5527 and commented

Consider the following scenario:

<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>old.groupId.bom</groupId>
    <artifactId>my-artifactId-bom</artifactId>
    <version>1.0</version>
    <packaging>pom</packaging>

    <distributionManagement>
        <relocation>
            <groupId>new.groupId.bom</groupId>
            <artifactId>my-artifactId-bom</artifactId>
            <version>2.0</version>
        </relocation>
    </distributionManagement>
</project>
<project>
    <modelVersion>4.0.0</modelVersion>

    <groupId>my.project.groupId</groupId>
    <artifactId>my-project</artifactId>
    <version>1.0</version>
    <packaging>war</packaging>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>old.groupId.bom</groupId>
                <artifactId>my-artifactId-bom</artifactId>
                <version>1.0</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    ...

</project>

The expected result according to [1]:
During building the "my-project" it should print the WARNING with the information about the relocation and it should be automatically redirected from old.groupId.bom:my-artifactId-bom:1.0 to new.groupId.bom:my-artifactId-bom:2.0 and use dependencies from the new pom.

Actual results:
There is no WARNING and no redirection to the new pom and maven is trying to obtain dependencies from the old pom (old.groupId.bom:my-artifactId-bom:1.0).
Nevertheless, when the pom is declared as a "normal dependency" (not in the "dependencyManagement" part) it works without any problem - it prints the WARNING and redirects to the new pom, but this is not the case we are using.

[1] http://maven.apache.org/guides/mini/guide-relocation.html


Remote Links:

0 votes, 8 watchers

Activity

  1. jira-importer commented on Jan 9, 2017

    @jira-importer
    Author

    Stephen Connolly commented

    Maven 3.4.0 has been dropped. See this thread for more details.

    This issue will need to be re-scheduled for a Maven release in the (hopefully near) future.

  2. jira-importer commented on Mar 25, 2017

    @jira-importer
    Author

    Christian Schulte commented

    Issue is fixed in the master branch of my private maven repository on github. When interested, you can cherry pick the commit to your own repository and create a pull request for the apache master branch with just this commit yourself from there.

  3. added
    bug
    priority:major
    on Jul 6, 2025
  4. modified the milestones: , 4.0.0 on Jul 7, 2025
  5. modified the milestones: 4.0.0, 4.1.0 on Mar 23, 2026
  6. goutamadwant commented on Sep 9, 2026

    @goutamadwant
    Contributor

    @gnodet Implemented BOM relocation in both model builders, with coverage for partial/chained relocations, cycles, and cached imports. The reported failure reproduces on untouched master and passes with the fix. Pls check #13081

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:major

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions