Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SBT - Failed to precise Play 2 app's project dependency

I'm creating a play 2 project using Scala as main language and so need a rest client implemented in Scala.

Unfortunately, I can't easily use the known Java Jersey-Client.

I found on github this probably great api: sjersey-client

Using SBT as dependency management tool, I try to indicate to play app its dependency to sjersey:

object ApplicationBuild extends Build {

  val appName = "myWebapp"
  val appVersion = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    jdbc,
    anorm
  )

  lazy val sjersey = RootProject(uri("git://github.com/FaKod/sjersey-client.git"))

  val main = play.Project(appName, appVersion, appDependencies).dependsOn(sjersey).settings(
    scalaVersion := "2.10.0"
  )

}

Then I run the command: play reload update but update failed:

[warn] Binary version (2.10) for dependency org.scala-lang#scala-library;2.10.0
[warn] in myWebapp#myWebapp_2.9.2;1.0-SNAPSHOT differs from Scala binary version in project (2.9.2).
[warn]  module not found: play#play_2.9.2;2.1-RC1              


[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: play#play_2.9.2;2.1-RC1: not found
[warn]  :: play#play-jdbc_2.9.2;2.1-RC1: not found
[warn]  :: play#anorm_2.9.2;2.1-RC1: not found
[warn]  :: play#play-test_2.9.2;2.1-RC1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[error] (mywebapp/*:update) sbt.ResolveException: unresolved dependency: play#play_2.9.2;2.1-RC1: not found
[error] unresolved dependency: play#play-jdbc_2.9.2;2.1-RC1: not found
[error] unresolved dependency: play#anorm_2.9.2;2.1-RC1: not found
[error] unresolved dependency: play#play-test_2.9.2;2.1-RC1: not found
[error] Total time: 4 s, completed 16 janv. 2013 19:36:37

But when I remove the dependsOn precision to Play! project, update and compilation are fine.

I'm blocked, what could be the issue?

like image 565
Mik378 Avatar asked Nov 12 '22 13:11

Mik378


1 Answers

You can also try this if you don't want update sjersey scala version :

object ApplicationBuild extends Build {

  val appName = "myWebapp"
  val appVersion = "1.0-SNAPSHOT"

  val appDependencies = Seq(
    jdbc,
    anorm
  )

  val moreResolvers = resolvers ++= Seq(
    "fakod-releases"   at   "https://raw.github.com/FaKod/fakod-mvn-repo/master/releases",
    "fakod-snapshots"  at   "https://raw.github.com/FaKod/fakod-mvn-repo/master/snapshots")

  val main = play.Project(appName, appVersion, appDependencies).settings(
    moreResolvers,
    libraryDependencies ++= Seq(
      "org.scala-libs" % "sjersey-client" %  "0.2.0" intransitive)

  )

}
like image 79
Maxime Calmels Avatar answered Nov 15 '22 06:11

Maxime Calmels