将Play JSON库添加到sbt

问题描述:

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

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

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

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

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

我遇到了这个错误:

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

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

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/.

使用SBT> = 0.13.5播放2.3 JSON

放入build.sbt:

put into build.sbt:

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

播放2.1

build.sbt:

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在Play 2.1中不是独立的工件.

Play JSON is in Play 2.1 not an independent artifact.