Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Play JSON Library to sbt

How can I add the Play JSON library (play.api.libs.json) to my sbt project?

When I added the following to my plugins.sbt file:

addSbtPlugin("play" % "sbt-plugin" % "2.1.0") 

I faced this error:

[warn]  :::::::::::::::::::::::::::::::::::::::::::::: [warn]  ::          UNRESOLVED DEPENDENCIES         :: [warn]  :::::::::::::::::::::::::::::::::::::::::::::: [warn]  :: play#sbt-plugin;2.1.0: not found [warn]  :::::::::::::::::::::::::::::::::::::::::::::: 

I did not find a resolver for this library, otherwise I would've added it and ran sbt update. Note that my resolvers includes http://repo.typesafe.com/typesafe/releases/.

like image 911
Kevin Meredith Avatar asked Oct 17 '13 19:10

Kevin Meredith


2 Answers

Play 2.2 is out and can be added separately from rest of Play Framework. in build.sbt:

resolvers += "Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/"  libraryDependencies += "com.typesafe.play" %% "play-json" % "2.2.1" 
like image 179
Karolis Avatar answered Sep 22 '22 00:09

Karolis


Play 2.3 JSON with SBT >= 0.13.5

put into build.sbt:

libraryDependencies += "com.typesafe.play" %% "play-json" % "2.3.4" 

Play 2.1

build.sbt:

resolvers += "Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/"  scalaVersion := "2.10.2"  libraryDependencies += "play" % "play_2.10" % "2.1.0" 

Play JSON is in Play 2.1 not an independent artifact.

like image 43
Schleichardt Avatar answered Sep 25 '22 00:09

Schleichardt