15

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?

Kim Stebel
  • 41,826
  • 12
  • 125
  • 142
iwein
  • 25,788
  • 10
  • 70
  • 111

1 Answers1

10

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".

Nathaniel Ford
  • 20,545
  • 20
  • 91
  • 102
Kim Stebel
  • 41,826
  • 12
  • 125
  • 142
  • dependeny-graph told me `org.scala-lang:scalap:2.9.1 (evicted by: 2.9.2)` could that be the culprit? – iwein Jan 02 '13 at 14:02
  • funny thing is that i've tried this exclusion against all my deps and it doesn't work... can't I globally exclude all artifacts under org.scala-lang with version 2.9.1? – iwein Jan 02 '13 at 14:05
  • Got it. Finally. Updated the answer to reflect the fix for context. – iwein Jan 02 '13 at 14:36
  • Additionally, I'm not sure if scalap is actually binary incompatible in the 2.9.x series or just the compile jar.... Glad to see the new warning is at least INFORMING you of potential issues :). – jsuereth Sep 15 '14 at 18:54