gpt4 book ai didi

scala - 无法获得 spray-json 依赖项以在游戏项目中工作

转载 作者:行者123 更新时间:2023-12-01 09:21:01 25 4
gpt4 key购买 nike

我花了无数个小时试图将 spray json 作为依赖项包含在我基于 scala 2.10 构建的 play 项目中。

有人可以为这个项目文件中使用的确切魔法咒语提供明确的解释吗?!!!!!

构建.scala:

import sbt._
import Keys._
import play.Project._

object ApplicationBuild extends Build {
val appName = "linscot"
val appVersion = "1.0"

val appDependencies = Seq(
jdbc,
anorm,
"mysql" % "mysql-connector-java" % "5.1.18",
"com.cloudphysics" % "jerkson_2.10" % "0.6.3",

//"cc.spray.json" % "spray-json_2.9.1" %"1.0.1"
"io.spray" % "spray-json_2.10.1" % "1.2.5"
)


val main = play.Project(appName, appVersion, appDependencies).settings(
// Add your own project settings here

//libraryDependencies += "io.spray" %% "spray-json" % "1.2.5"


)
}

得到这个:

[info] Updating {file:/Users/Joel/Projects/linscot-server/}linscot...
[warn] module not found: io.spray#spray-json_2.10.1;1.2.5
[warn] ==== local: tried
[warn] /Users/Joel/.ivy2/local/io.spray/spray-json_2.10.1/1.2.5/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/io/spray/spray-json_2.10.1/1.2.5/spray-json_2.10.1-1.2.5.pom
[warn] ==== Typesafe Snapshots Repository: tried
[warn] http://repo.typesafe.com/typesafe/snapshots/io/spray/spray-json_2.10.1/1.2.5/spray-json_2.10.1-1.2.5.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/io/spray/spray-json_2.10.1/1.2.5/spray-json_2.10.1-1.2.5.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: io.spray#spray-json_2.10.1;1.2.5: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] (*:update) sbt.ResolveException: unresolved dependency: io.spray#spray-json_2.10.1;1.2.5: not found
[warn] some of the dependencies were not recompiled properly, so classloader is not avaialable
[info] Updating {file:/Users/Joel/Projects/linscot-server/}linscot...
[warn] module not found: io.spray#spray-json_2.10.1;1.2.5
[warn] ==== local: tried
[warn] /Users/Joel/.ivy2/local/io.spray/spray-json_2.10.1/1.2.5/ivys/ivy.xml
[warn] ==== Typesafe Releases Repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/io/spray/spray-json_2.10.1/1.2.5/spray-json_2.10.1-1.2.5.pom
[warn] ==== Typesafe Snapshots Repository: tried
[warn] http://repo.typesafe.com/typesafe/snapshots/io/spray/spray-json_2.10.1/1.2.5/spray-json_2.10.1-1.2.5.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/io/spray/spray-json_2.10.1/1.2.5/spray-json_2.10.1-1.2.5.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: io.spray#spray-json_2.10.1;1.2.5: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] (*:update) sbt.ResolveException: unresolved dependency: io.spray#spray-json_2.10.1;1.2.5: not found

最佳答案

spray-json 依赖的格式是:

"io.spray" %%  "spray-json" % "1.2.5"

使用 %% 确保您获得适合您正在使用的 Scala 版本的正确版本。

Spray 不使用默认存储库之一来分发库,因此您还必须指定那个存储库。然后设置变成:

val main = play.Project(appName, appVersion, appDependencies).settings(   
resolvers += "spray" at "http://repo.spray.io/",
libraryDependencies += "io.spray" %% "spray-json" % "1.2.5"
)

关于scala - 无法获得 spray-json 依赖项以在游戏项目中工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18886475/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com