将 Play JSON 库添加到 sbt [英] Adding Play JSON Library to sbt

查看:23
本文介绍了将 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/.

推荐答案

Play 2.3 JSON with SBT >= 0.13.5

放入build.sbt:

put into 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"

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

Play JSON is in Play 2.1 not an independent artifact.

这篇关于将 Play JSON 库添加到 sbt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆