Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to import Play framework as a dependency in Scala project

I forked btce-scala, so I can work on a trading bot. I'm cleaning up this library by adding the normal sbt project structure, making a build.sbt, etc:

~/code/scala/btce-scala) cat build.sbt
name := "btce-scala"

version := "0.1"

resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/"

scalaVersion := "2.10.3"

libraryDependencies ++= Seq(
    "net.liftweb" % "lift-json_2.9.1" % "2.6-M2",
    "org.specs2" %%  "specs2" % "2.3.8" % "test",
    "joda-time" % "joda-time" % "2.3",
    "org.joda" % "joda-convert" % "1.6",
    "commons-codec" % "commons-codec" % "1.9",
    "com.typesafe.play" % "play_2.2.2" % "2.2.2"
)

My problem is that I'm not sure how to import the latest version of Play framework. I need it to use play.api.libs.ws.WS.

~/code/scala/btce-scala 🚀  sbt run
[info] Set current project to btce-scala (in build file:/Users/bryangarza/code/scala/btce-scala/)
[info] Updating {file:/Users/bryangarza/code/scala/btce-scala/}btce-scala...
[info] Resolving com.typesafe.play#play_2.2.2;2.2.2 ...
[warn]  module not found: com.typesafe.play#play_2.2.2;2.2.2
[warn] ==== local: tried
[warn]   /Users/bryangarza/.ivy2/local/com.typesafe.play/play_2.2.2/2.2.2/ivys/ivy.xml
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/com/typesafe/play/play_2.2.2/2.2.2/play_2.2.2-2.2.2.pom
[warn] ==== Typesafe Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/com/typesafe/play/play_2.2.2/2.2.2/play_2.2.2-2.2.2.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.typesafe.play#play_2.2.2;2.2.2: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: com.typesafe.play#play_2.2.2;2.2.2: not found

...

[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.play#play_2.2.2;2.2.2: not found

Obviously this is because it can't find Play_2.2.2, but where can I find this repo so I can add it to sbt?

like image 205
Emil Avatar asked Dec 16 '22 00:12

Emil


1 Answers

Your dependency is wrong. Use this instead:

libraryDependencies ++= Seq("com.typesafe.play" %% "play" % "2.2.2")
like image 95
Rado Buransky Avatar answered Mar 06 '23 04:03

Rado Buransky