2

I'm trying to following this tutorial, but I'm getting the same error for two days. i found some similar questions here in SO, but any of them helped me (maybe is because my lack of knowledge in scala and sbt).

Here is my build.sbt

name := "fitman"

version := "1.0"

scalaVersion := "2.11.6"

lazy val versions = new {
  val finatra = "2.1.2"
  val logback = "1.1.3"
}

resolvers ++= Seq(
  Resolver.sonatypeRepo("releases"),
  "Twitter Maven" at "https://maven.twttr.com"
)

libraryDependencies += "com.twitter.finatra" %% "finatra-http" % versions.finatra
libraryDependencies += "com.twitter.finatra" %% "finatra-slf4j" % versions.finatra
libraryDependencies += "ch.qos.logback" % "logback-classic" % versions.logback

Here is the warnings that I'm trying to understand:

SBT project import
                [warn] Scala version was updated by one of library dependencies:
                [warn]  * org.scala-lang:scala-library:(2.11.6, 2.11.4, 2.11.0, 2.11.2) -> 2.11.7
                [warn] To force scalaVersion, add the following:
                [warn]  ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }
                [warn] Run 'evicted' to see detailed eviction warnings
                [warn] Multiple dependencies with the same organization/name but different versions. To avoid conflict, pick one version:
                [warn]  * org.scala-lang:scala-library:(2.11.7, 2.11.6)
                [warn]  * org.scala-lang:scala-reflect:(2.11.7, 2.11.6)
                [warn]  * org.scala-lang.modules:scala-parser-combinators_2.11:(1.0.4, 1.0.3)
                [warn]  * org.scala-lang.modules:scala-xml_2.11:(1.0.5, 1.0.3)
James
  • 1,653
  • 2
  • 31
  • 60

1 Answers1

3

One of the libraries you are using requires Scala 2.11.7, so SBT is overriding your scalaVersion setting with it. Update the version of Scala in your build file:

scalaVersion := "2.11.7"
HTNW
  • 27,182
  • 1
  • 32
  • 60
  • 1
    Actually there is no need not be on the latest version which is 2.11.8 right now. – marios Dec 23 '16 at 00:50
  • I installed my scala using `apt-get` in Ubuntu and my version is indeed the 2.11.6. Should I update it manually or change the library version? – James Dec 23 '16 at 16:07
  • 1
    Scala in the repos is outdated; download the latest versions off http://scala-lang.org. If you change it in the sbt file then it will download a copy of the library just for your own user. – HTNW Dec 23 '16 at 17:23