Ste*_*sky 1 scala sbt play-json
我的build.sbt文件(sbt版本0.13.8):
lazy val commonSettings = Seq(
version := "1.0.0",
scalaVersion := "2.11.6"
)
resolvers += "Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/"
lazy val root = (project in file(".")).
settings(commonSettings: _*).
settings(
name := "myapp",
libraryDependencies ++= Seq(
"com.typesafe.play" % "play-json" % "2.3.4",
"org.scalatest" % "scalatest_2.11" % "2.2.4" % "test",
"junit" % "junit" % "4.12" % "test"
)
)
scalacOptions ++= Seq("-unchecked", "-feature", "-deprecation")
Run Code Online (Sandbox Code Playgroud)
我在尝试编译项目时遇到此错误:
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.play#play-json_2.11;2.3.4: not found
[error] Total time: 0 s, completed Apr 17, 2015 5:59:28 PM
Run Code Online (Sandbox Code Playgroud)
我怎样才能获得这个play-json库scala 2.11.6?
你需要告诉sbt scala版本应该使用哪个版本.
你可以明确:
"com.typesafe.play" % "play-json_2.11" % "2.3.4",
Run Code Online (Sandbox Code Playgroud)
或者使用%%(sbt doc)如下命令sbt使用scalaVersion:
"com.typesafe.play" %% "play-json" % "2.3.4",
Run Code Online (Sandbox Code Playgroud)