eswenson
eswenson

Reputation: 755

How to determine what dependency is forcing the scala version to be 2.10 when scalaVersion is set to 2.11.2

I'm trying to build the lunatech-securesocial-poc project with scala 2.11.2 and I've updated the scalaVersion in projects/Build.scala. This project depends on securesocial, which I've built locally with 2.11.2 and named its artifact version master-SNAPSHOT. I've updated the dependency in lunatech-securesocial-poc's project to use this version of securesocial. However, SBT (activator) fails to compile because it is looking for ws.securesocial#securesocial_2.10;master-SNAPSHOT. How can I find out what is causing the scala version to be overridden to 2.10. I want 2.11.2. Obviously some dependency is forcing it, but I want to find out what that dependency is, and fix it.

I've tried adding:

dependencyOverrides += "org.scala-lang" % "scala-library" % scalaVersion.value

evictionWarningOptions := EvictionWarningOptions.default.withWarnTransitiveEvictions(true).withWarnDirectEvictions(true).withWarnScalaVersionEviction(true) ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }

to my Build.scala and I'm using SBT version 0.13.7. I don't see why it is so hard for SBT to just abort and tell me that XXX dependency is preventing it from using 2.11.2 and requiring 2.10.

Anyone?

Upvotes: 1

Views: 1569

Answers (2)

eswenson
eswenson

Reputation: 755

The issue turned out to be in my Build.scala. While I defined scalaVersion and used it in setting up dependencies, I didn't pass a setting to the Project that overrode the default scalaVersion, which evidently is the one used to build activator (2.10.4). So despite thinking I had set scalaVersion, I hadn't really.

Upvotes: 1

Alexey Romanov
Alexey Romanov

Reputation: 170909

You can use sbt-dependency-graph plugin to find this out.

Upvotes: 4

Related Questions