So I’m using Play 2 in Scala, setting up some dependencies, and I think I’m tickling a bug in SBT. Anybody else seen anything like this?
I try to add knockoff in Build.scala as directed, thus:
val knockoff = RootProject(uri("git://github.com/tristanjuricek/knockoff.git"))
val main =
PlayProject(appName, appVersion, appDependencies, mainLang = SCALA)
.dependsOn(knockoff)
and then run it. For some reason, it goes looking for source and javadoc jars. (Why?)
[warn] [NOT FOUND ] com.tristanhunt#knockoff_2.9.1;0.8.0-16!knockoff_2.9.1.jar(src) (88ms)
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/com/tristanhunt/knockoff_2.9.1/0.8.0-16/knockoff_2.9.1-0.8.0-16-sources.jar
[warn] [NOT FOUND ] com.tristanhunt#knockoff_2.9.1;0.8.0-16!knockoff_2.9.1.jar(doc) (86ms)
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/com/tristanhunt/knockoff_2.9.1/0.8.0-16/knockoff_2.9.1-0.8.0-16-javadoc.jar
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: FAILED DOWNLOADS ::
[warn] :: ^ see resolution messages for details ^ ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: com.tristanhunt#knockoff_2.9.1;0.8.0-16!knockoff_2.9.1.jar(src)
[warn] :: com.tristanhunt#knockoff_2.9.1;0.8.0-16!knockoff_2.9.1.jar(doc)
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
These missing jars shouldn’t be fatal, but they are:
[error] {file:/home/joel/TEST2/bar/}bar/*:update: sbt.ResolveException: download failed: com.tristanhunt#knockoff_2.9.1;0.8.0-16!knockoff_2.9.1.jar(src)
[error] download failed: com.tristanhunt#knockoff_2.9.1;0.8.0-16!knockoff_2.9.1.jar(doc)
[error] java.util.NoSuchElementException: Either.right.value on Left
[error] Use 'last' for the full log.
Here’s some of the stack trace:
[error] download failed: com.tristanhunt#knockoff_2.9.1;0.8.0-16!knockoff_2.9.1.jar(doc)
java.util.NoSuchElementException: Either.right.value on Left
at scala.Either$RightProjection.get(Either.scala:229)
at sbt.PlayCommands$$anonfun$56.apply(PlayCommands.scala:606)
at sbt.PlayCommands$$anonfun$56.apply(PlayCommands.scala:593)
at sbt.Command$$anonfun$sbt$Command$$apply1$1$$anonfun$apply$6.apply(Command.scala:74)
at sbt.Command$.process(Command.scala:92)
Other projects as dependencies work fine, but not this one.
Ugh. Sorry for wasting your time, Interwebs.
The problem was that the “parent” and “child” projects specified different scalaVersions.
The parent was 2.9.1, child 2.9.2. Changing either one to be the same as the other fixes this problem.