Despite doing the following, sbt is still grabbing lift-json. Why?
"net.liftweb" %% "lift-mapper" % "2.6-M4" % "compile" excludeAll(ExclusionRule("net.liftweb", "lift-json"))
More info. This is what dependency tree shows:
+-net.liftweb:lift-mapper_2.10:2.6-M4
[info] | +-net.liftweb:lift-db_2.10:2.6-M4
[info] | | +-net.liftweb:lift-util_2.10:2.6-M4
[info] | | | |
…
[info] | | | |
[info] | | | +-net.liftweb:lift-json_2.10:2.6-M4
So dependency is lift-mapper -> lift-db -> lift-util -> lift-json, perhaps exclusion is not deep?
The key thing here that's not obvious is that exclusions in sbt are really just pass-through rules for the underlying Ivy engine. Since Ivy knows nothing about sbt conventions (for instance, appending _2.10
to dependencies that are Scala release specific), you need to tell it what it should really be excluding. In this case, that means the line should look like this:
"net.liftweb" %% "lift-mapper" % "2.6-M4" % "compile" excludeAll(ExclusionRule("net.liftweb", "lift-json_2.10"))
Perhaps there is some enhancement that can be made to sbt to allow it to see that since the dependency you've defined is Scala release specific, it should also try adding the exclusion rule for that release, as well.
Perhaps there are some other libraries depend on it. You can find those libs by using the sbt-dependency-graph plugin. Or simply exclude it from all the dependencies:
libraryDependencies ++= Seq(
......
).map(_.excludeAll(ExclusionRule("net.liftweb", "lift-json")))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With