question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transitive dependency causes wrong evictions

See original GitHub issue

In the example below my build.sbt depends on the angular webjar 1.4.7. My other dependency depends on angular webjar version [1.3.0). However the newest version of said jar is 1.5.0-beta.2

Expected: angular jar version 1.4.7 to be used, as it satisfies both requirement Actual: angular 1.4.7 evicted, and 1.5.0-beta.2 used instead, which does not satisfy my main build.sbt requirements (version 1.4.7)

organization := "vandra.hu"

name := "sbt-bug"

version := "0.0.1"

scalaVersion := "2.11.6"

scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8", "-feature")

libraryDependencies ++= Seq(
   "org.webjars.bower" % "angular" % "1.4.7"
  ,"org.webjars.bower" % "angular-bootstrap" % "0.14.2"
)

pom.xml of angular-bootstrap:

(...)
        <dependency>
            <groupId>org.webjars.bower</groupId>
            <artifactId>angular</artifactId>
            <version>[1.3.0,)</version>
        </dependency>

Run results:

akovanm0:foo avandra$ sbt sbtVersion evicted
[info] Set current project to sbt-bug (in build file:/Users/avandra/projects/foo/)
[info] 0.13.6
[info] Updating {file:/Users/avandra/projects/foo/}foo...
[info] Resolving jline#jline;2.12.1 ...
[info] Done updating.
[warn] There may be incompatibilities among your library dependencies.
[warn] Here are some of the libraries that were evicted:
[warn]  * org.webjars.bower:angular:1.4.7 -> 1.5.0-beta.2 (caller: org.webjars.bower:angular-bootstrap:0.14.2, vandra.hu:sbt-bug_2.11:0.0.1)
[success] Total time: 1 s, completed Nov 27, 2015 12:39:19 PM

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
eed3si9ncommented, Jan 4, 2017

Given that most people use the default Ivy conflict manager that picks the “latest”, perhaps we could provide an option to ignore the dynamic-ness of the dynamic revision when we translate POM, and everyone would be happy.

For example, if we treat Maven’s [1.3.0,) as Ivy 1.3.0, and your build.sbt brings in another Ivy 1.4.7, it will pick up 1.4.7 as you expected.

0reactions
eed3si9ncommented, Aug 9, 2019

I confirmed using sbt 1.3.0-RC3 that 1.4.7 gets picked.

[warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
[info] * Attributed(/Users/eed3si9n/.coursier/cache/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.11.6/scala-library-2.11.6.jar)
[info] * Attributed(/Users/eed3si9n/.coursier/cache/v1/https/repo1.maven.org/maven2/org/webjars/bower/angular/1.4.7/angular-1.4.7.jar)
[info] * Attributed(/Users/eed3si9n/.coursier/cache/v1/https/repo1.maven.org/maven2/org/webjars/bower/angular-bootstrap/0.14.2/angular-bootstrap-0.14.2.jar)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Preventing Version Conflicts with versionScheme
A library that you pulled could depend on other libraries, and the transitive dependencies could cause version conflicts.
Read more >
SBT: is it wise to fix eviction warnings of library dependencies
For evicted transitive dependencies (those dependencies only used directly by your own dependencies), it's likely best to simply leave the ...
Read more >
sbt-build has eviction bug / duplicate libraries
Hi, there is a severe problem with the built-in sbt compilation / dependency-model. I have a library A that is published with a...
Read more >
semantics of dependency resolvers - eed3si9n
A dependency resolver, or package manager, is a program that determines a consistent set of modules based on a set of constraints provided...
Read more >
The server failed to start. See details for the ... - Mendix Forum
Hi all, Since I updated a project from 7.23.7 to 8.6.2 (Couldn't select from the dropdown) I'm having issues with evictions which is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found