gpt4 book ai didi

scala - SBT - 无法精确 Play 2 应用程序的项目依赖项

转载 作者:行者123 更新时间:2023-12-04 21:45:59 28 4
gpt4 key购买 nike

我正在创建一个使用 Scala 作为主要语言的 play 2 项目,因此需要一个在 Scala 中实现的休息客户端。

不幸的是,我不能轻易使用已知的 Java Jersey-Client。

我在 github 上发现了这个可能很棒的 api:sjersey-client

使用 SBT 作为依赖管理工具,我尝试指示 play app 对 sjersey 的依赖:

object ApplicationBuild extends Build {

val appName = "myWebapp"
val appVersion = "1.0-SNAPSHOT"

val appDependencies = Seq(
jdbc,
anorm
)

lazy val sjersey = RootProject(uri("git://github.com/FaKod/sjersey-client.git"))

val main = play.Project(appName, appVersion, appDependencies).dependsOn(sjersey).settings(
scalaVersion := "2.10.0"
)

}

然后我运行命令: play reload update但更新失败:
[warn] Binary version (2.10) for dependency org.scala-lang#scala-library;2.10.0
[warn] in myWebapp#myWebapp_2.9.2;1.0-SNAPSHOT differs from Scala binary version in project (2.9.2).
[warn] module not found: play#play_2.9.2;2.1-RC1


[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: play#play_2.9.2;2.1-RC1: not found
[warn] :: play#play-jdbc_2.9.2;2.1-RC1: not found
[warn] :: play#anorm_2.9.2;2.1-RC1: not found
[warn] :: play#play-test_2.9.2;2.1-RC1: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] (mywebapp/*:update) sbt.ResolveException: unresolved dependency: play#play_2.9.2;2.1-RC1: not found
[error] unresolved dependency: play#play-jdbc_2.9.2;2.1-RC1: not found
[error] unresolved dependency: play#anorm_2.9.2;2.1-RC1: not found
[error] unresolved dependency: play#play-test_2.9.2;2.1-RC1: not found
[error] Total time: 4 s, completed 16 janv. 2013 19:36:37

但是当我删除 dependsOn 时精准玩!项目,更新和编译都很好。

我被屏蔽了,可能是什么问题?

最佳答案

如果您不想更新 sjersey scala 版本,也可以尝试此操作:

object ApplicationBuild extends Build {

val appName = "myWebapp"
val appVersion = "1.0-SNAPSHOT"

val appDependencies = Seq(
jdbc,
anorm
)

val moreResolvers = resolvers ++= Seq(
"fakod-releases" at "https://raw.github.com/FaKod/fakod-mvn-repo/master/releases",
"fakod-snapshots" at "https://raw.github.com/FaKod/fakod-mvn-repo/master/snapshots")

val main = play.Project(appName, appVersion, appDependencies).settings(
moreResolvers,
libraryDependencies ++= Seq(
"org.scala-libs" % "sjersey-client" % "0.2.0" intransitive)

)

}

关于scala - SBT - 无法精确 Play 2 应用程序的项目依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14365406/

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