添加播放JSON库到sbt
我如何添加Play JSON库( play.api.libs.json
)到我的sbt项目?
当我将以下内容添加到我的plugins.sbt
文件中时:
addSbtPlugin("play" % "sbt-plugin" % "2.1.0")
我遇到了这个错误:
[warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: UNRESOLVED DEPENDENCIES :: [warn] :::::::::::::::::::::::::::::::::::::::::::::: [warn] :: play#sbt-plugin;2.1.0: not found [warn] ::::::::::::::::::::::::::::::::::::::::::::::
我没有find这个库的parsing器,否则我会添加它,并运行sbt update
。 请注意,我的resolvers
包括http://repo.typesafe.com/typesafe/releases/ 。
播放2.3 JSON与SBT> = 0.13.5
放入build.sbt:
libraryDependencies += "com.typesafe.play" %% "play-json" % "2.3.4"
玩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"
玩JSON是在Play 2.1不是一个独立的神器。
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"
这工作对我来说(斯卡拉2.11)
resolvers += "Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/"
libraryDependencies += "com.typesafe.play" %% "play-json" % "2.3.0"
您可以使用以下来获取Play JSON库:
addSbtPlugin("play" % "play-json" % "2.2-SNAPSHOT")
您可能还必须包含以下parsing器:
"Mandubian repository snapshots" at "https://github.com/mandubian/mandubian-mvn/raw/master/snapshots/"
这里是我最初得到的信息: http : //mandubian.com/2013/02/21/play-json-stand-alone/
可以检查GitHub存储库的入门部分,并将以下内容添加到build.sbt
文件中:
libraryDependencies += "com.typesafe.play" %% "play-json" % "2.6.0-M1"