将Play JSON库添加到sbt

Kev*_*ith 45 sbt playframework playframework-2.1

如何将Play JSON库(play.api.libs.json)添加到我的sbt项目中?

当我将以下内容添加到我的plugins.sbt文件中时:

addSbtPlugin("play" % "sbt-plugin" % "2.1.0")
Run Code Online (Sandbox Code Playgroud)

我遇到了这个错误:

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: play#sbt-plugin;2.1.0: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
Run Code Online (Sandbox Code Playgroud)

我没有找到这个库的解析器,否则我会添加它并运行sbt update.请注意,我resolvers包括http://repo.typesafe.com/typesafe/releases/.

Kar*_*lis 77

Play 2.2已经发布,可以与Play Framework的其余部分分开添加.在build.sbt中:

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

libraryDependencies += "com.typesafe.play" %% "play-json" % "2.2.1"
Run Code Online (Sandbox Code Playgroud)


Sch*_*rdt 37

使用SBT> = 0.13.5播放2.3 JSON

放入build.sbt:

libraryDependencies += "com.typesafe.play" %% "play-json" % "2.3.4"
Run Code Online (Sandbox Code Playgroud)

玩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"
Run Code Online (Sandbox Code Playgroud)

Play JSON在Play 2.1中不是一个独立的工件.


Rau*_*aul 11

这对我有用(scala 2.11)

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

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