Skip to content

dependencyOverrides are not taken into account for ivy #7951

@RustedBones

Description

@RustedBones

steps

When publishing a module overriding a dependency version with dependencyOverrides, I expect to find this version in the artifact dependencies.

problem

You can find a minimal setup here to reproduce the problem:

When a project has the following setup:

libraryDependencies +=  "org.slf4j" % "slf4j-api" % "managed"
dependencyOverrides +=  "org.slf4j" % "slf4j-api" % "2.0.16"

it creates the expected pom file with makePom

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>2.0.16</version>
</dependency>

but does not take in account the dependencyOverrides for the ivy file in makeIvyXml

<dependency org="org.slf4j" name="slf4j-api" rev="managed" conf="compile->default(compile)"> </dependency>

This has been an issue when relying on ivy repository (ie with publishLocal). When trying to depend on the published artifact, the transitive dependency cannot be resolved.

expectation

Both maven and ivy should use the overridden versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions