8000 dependencyOverrides are not taken into account for ivy · Issue #7951 · sbt/sbt · GitHub
[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependencyOverrides are not taken into account for ivy #7951

Open
RustedBones opened this issue Dec 16, 2024 · 4 comments
Open

dependencyOverrides are not taken into account for ivy #7951

RustedBones opened this issue Dec 16, 2024 · 4 comments
Labels

Comments

@RustedBones
Copy link
Contributor
RustedBones commented Dec 16, 2024

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

@eed3si9n
Copy link
Member

It's working as intended - https://www.scala-sbt.org/1.x/docs/Library-Management.html#Overriding+a+version

Note: this is an Ivy-only feature and will not be included in a published pom.xml.

@eed3si9n
Copy link
Member

@RustedBones
Copy link
Contributor Author

Ha ok. To me the doc states the overridden transitive version is not added to the ivy file. In the case above, the override affects a direct dependency.

But I understand that the override mechanism for ivy does not care if the dependency is direct or transitive, it simply does not propagate to the ivy file.

@eed3si9n eed3si9n reopened this Dec 16, 2024
@eed3si9n
Copy link
Member

Sorry I misunderstood the bug report. I thought you were saying it doesn't work on Maven.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0