Question

My project gives the following warning:

[warn] Potentially incompatible versions of dependencies of {file:/some/path/}default-5bae4a:
[warn]    org.scala-lang: 2.9.2, 2.9.1

I've got the following dependencies:

libraryDependencies ++= Seq(
  "io.spray"            %   "spray-can"     % "1.0-M3",
  "io.spray"            %   "spray-routing" % "1.0-M3",
  "io.spray"            %   "spray-testkit" % "1.0-M3",
  "io.spray"            %%  "spray-json"    % "1.2.3" cross CrossVersion.full,
  "com.typesafe.akka"   %   "akka-actor"    % "2.0.3",
  "org.mongodb"         %% "casbah"         % "2.4.1",
  "com.novus"           %% "salat"          % "1.9.1",
  "org.specs2"          %%  "specs2"        % "1.12.2" % "test",
  "org.mockito"         % "mockito-all"     % "1.9.0" % "test"
)

I'm trying to figure our how and to get rid the org.scala-lang 2.9.1 dependency, but it's not as easy as I thought it should be. What trick am I missing?

Was it helpful?

Solution

First you need to find out which dependency causes this problem by disabling them one by one. Then you can either use a version of that library compiled against 2.9.2 or if there is no such version you can exclude the dependency.

A great tool to figure out which dependency is causing the problem is sbt-dependency-graph.

To exclude a transitive dependency, you can use the exclude method:

libraryDependencies +=
    "com.novus" %% "salat" % "1.9.1" exclude("org.scala-lang", "scalap"),

See here under "Exclude transitive dependencies".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top