Search code examples
playframework-2.0scalaquery

Configure ScalaQuery in a Play 2.0 project


I wanted to try out using ScalaQuery with the Play! Framework (version 2.0.2) but I can't get it to work. I added the following line to the Build.scala file :

  val appDependencies = Seq(
    "org.scalaquery" %% "scalaquery" % "0.9.5"
  )

But when I run the 'play dependencies' command i keep getting

sbt.ResolveException: unresolved dependency: org.scalaquery#scalaquery_2.9.1;0.9.5: not found

I tried to add the jars to the IntelliJ but obviously that wasn't enough, and I have no idea how I would get play to recognize the jars. Has anyone succeded to get ScalaQuery (or Slick) to work in Play 2 ?


Solution

  • According to the current ScalaQuery download page, it has been built against scala-2.9.0-1 whereas Play is using scala-2.9.1. So you need to explicitly append the scala version you want of your dependency:

    "org.scalaquery" % "scalaquery_2.9.0-1" % "0.9.5"