sbt - Why does the build insist on looking for Scala 2.10 version of dependencies? -
i have root build.sbt
file looks this:
organization := "com.acme.foo" name := "foo-parent" version := "1.0-snapshot" scalaversion := "2.11.2" scalacoptions := seq("-unchecked", "-deprecation", "-encoding", "utf8") resolvers ++= seq( "spray repo" @ "http://repo.spray.io/" ) lazy val root = project.dependson(rest,backend) lazy val rest = project lazy val backend = project.dependson(rest).settings(mainclass in (compile, run) := some("com.acme.foo.main"), fork in run := true) run in compile <<= (run in compile in backend)
in both backend
, rest
modules scalaversion
set 2.11.2, keep getting error when try compile root:
[warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: unresolved dependencies :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: com.acme.foo#rest_2.10;1.0-snapshot: not found [warn] :: com.acme#foo_2.10;1.0-snapshot: not found [warn] ::::::::::::::::::::::::::::::::::::::::::::::
why insist on looking _2.10 versions of modules?
i couldn't tell why worked, followed this answer, , solved problem
someone had asked me in comments result of executing sbt scalaversion
was. was:
[info] backend/*:scalaversion [info] 2.11.2 [info] rest/*:scalaversion [info] 2.11.2 [info] root/*:scalaversion [info] 2.10.3 [info] foo/*:scalaversion [info] 2.11.2
after taking advice other post replacing scalaversion := "2.11.2"
in root's build.sbt file with:
scalaversion in thisbuild := "2.11.2"
i got correct result sbt scalaversion
, , compile worked fine:
[info] backend/*:scalaversion [info] 2.11.2 [info] rest/*:scalaversion [info] 2.11.2 [info] root/*:scalaversion [info] 2.11.2 [info] foo/*:scalaversion [info] 2.11.2
sbt baffles me sometimes... must confess haven't invested lot of time in understanding it.
Comments
Post a Comment