Playframework 如何将播放json依赖项添加到项目中?

Playframework 如何将播放json依赖项添加到项目中?,playframework,playframework-2.0,sbt,Playframework,Playframework 2.0,Sbt,我想向sbt项目添加播放json依赖项 我在项目/plugins.sbt中添加了类型安全存储库: resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/" 然后我在Build.scala中添加了play json依赖项,如下所示: libraryDependencies += "com.typesafe.play" % "play-json_2.10" % "2.2.1" [warn

我想向sbt项目添加
播放json
依赖项

我在
项目/plugins.sbt
中添加了类型安全存储库:

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
然后我在
Build.scala
中添加了
play json
依赖项,如下所示:

libraryDependencies += "com.typesafe.play" % "play-json_2.10" % "2.2.1"
[warn]  module not found: com.typesafe.play#play-json_2.10;2.2.1
[warn] ==== local: tried
[warn]   /home/tminglei/.ivy2/local/com.typesafe.play/play-json_2.10/2.2.1/ivys/ivy.xml
[warn] ==== sonatype-snapshots: tried
[warn]   https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/play/play-json_2.10/2.2.1/play-json_2.10-2.2.1.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/com/typesafe/play/play-json_2.10/2.2.1/play-json_2.10-2.2.1.pom
[info] Resolving org.scala-tools.testing#test-interface;0.5 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.typesafe.play#play-json_2.10;2.2.1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
这样,我得到了如下错误:

libraryDependencies += "com.typesafe.play" % "play-json_2.10" % "2.2.1"
[warn]  module not found: com.typesafe.play#play-json_2.10;2.2.1
[warn] ==== local: tried
[warn]   /home/tminglei/.ivy2/local/com.typesafe.play/play-json_2.10/2.2.1/ivys/ivy.xml
[warn] ==== sonatype-snapshots: tried
[warn]   https://oss.sonatype.org/content/repositories/snapshots/com/typesafe/play/play-json_2.10/2.2.1/play-json_2.10-2.2.1.pom
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/com/typesafe/play/play-json_2.10/2.2.1/play-json_2.10-2.2.1.pom
[info] Resolving org.scala-tools.testing#test-interface;0.5 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.typesafe.play#play-json_2.10;2.2.1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

如何排序?

看起来它没有使用您定义的解析器。这在sbt 13中适用于我:

import sbt._
import Keys._

object Build extends sbt.Build {

  lazy val playjsondep = Project(
    id = "play-json-dep",
    base = file("."),
    settings = Project.defaultSettings ++ Seq(
      name := "play-json-dep",
      organization := "ee.so",
      version := "0.1-SNAPSHOT",
      scalaVersion := "2.10.2",
      resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/",
      libraryDependencies += "com.typesafe.play" %% "play-json" % "2.2.1"
    )
  )
}

由于依赖项不是插件,因此您应该只在项目的主目录中将
resolvers
设置添加到
build.sbt

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

对于这样一个简单的配置,您真的不需要
project/*.scala
文件。

文件
plugins.sbt
?它的路径是:/[project\u root]/project/plugins.sbt