gpt4 book ai didi

scala - Unresolved 依赖 SBT org.scala-sbt#sbt_2.9.1;0.12.1 : not found, Play 示例

转载 作者:行者123 更新时间:2023-12-04 10:26:54 28 4
gpt4 key购买 nike

我正在尝试在 Play 2.0 框架中运行示例,但是当我去运行“play”或“sbt”时。

当我转到目录“/samples/scala/helloworld”时,我执行“sbt”并获得:

    [info] Loading project definition from C:\src\Play20\samples\scala\helloworld\project
[warn] module not found: play#sbt-plugin;2.0
[warn] ==== typesafe-ivy-releases: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.0/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn] http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.0/ivys/ivy.xml
[warn] ==== local: tried
[warn] C:\Users\labra\.ivy2\local\play\sbt-plugin\scala_2.9.2\sbt_0.12\2.0\ivys\ivy.xml
[warn] ==== Typesafe repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/play/sbt-plugin_2.9.2_0.12/2.0/sbt-plugin-2.0.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/play/sbt-plugin_2.9.2_0.12/2.0/sbt-plugin-2.0.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: play#sbt-plugin;2.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] play:sbt-plugin:2.0 (sbtVersion=0.12, scalaVersion=2.9.2)
[warn]
sbt.ResolveException: unresolved dependency: play#sbt-plugin;2.0: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:214)
. . .

at java.lang.Thread.run(Thread.java:722)
[error] (*:update) sbt.ResolveException: unresolved dependency: play#sbt-plugin;2.0: not found
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
[info] Loading project definition from C:\src\Play20\samples\scala\helloworld\project
[warn] module not found: play#sbt-plugin;2.0
[warn] ==== typesafe-ivy-releases: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.0/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn] http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/play/sbt-plugin/scala_2.9.2/sbt_0.12/2.0/ivys/ivy.xml
[warn] ==== local: tried
[warn] C:\Users\labra\.ivy2\local\play\sbt-plugin\scala_2.9.2\sbt_0.12\2.0\ivys\ivy.xml
[warn] ==== Typesafe repository: tried
[warn] http://repo.typesafe.com/typesafe/releases/play/sbt-plugin_2.9.2_0.12/2.0/sbt-plugin-2.0.pom
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/play/sbt-plugin_2.9.2_0.12/2.0/sbt-plugin-2.0.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: play#sbt-plugin;2.0: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] play:sbt-plugin:2.0 (sbtVersion=0.12, scalaVersion=2.9.2)
[warn]
sbt.ResolveException: unresolved dependency: play#sbt-plugin;2.0: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:214)
at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:122)
. . .
at java.lang.Thread.run(Thread.java:722)
[error] (*:update) sbt.ResolveException: unresolved dependency: play#sbt-plugin;2.0: not found
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q

我从 http://www.scala-sbt.org/release/docs/Getting-Started/Setup 安装了 sbt 12.1 版

我在这里注意到一个类似的问题: https://groups.google.com/forum/?fromgroups=#!topic/simple-build-tool/DGUbWsgZiLw

在答案中,它似乎与 SBT 的“启动器”版本有关,我怎么知道我的启动器 sbt 版本是哪个?我该如何更新它?

我还尝试从源代码编译 xsbt,但是在运行“sbt build-all”时,我得到:
    . . .
[info] Reading library jar [C:\compi\jdk\jre\lib\rt.jar]
[error] Error: Can't read [proguard.ClassPathEntry@73abdb5e] (Can't process class [com/oracle/net/Sdp$1.class] (Unsupported version number [51.0] for class format))
[error] java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
[error] Use 'last' for the full log.

但是,我的问题不是要编译 xsbt,而是要知道如何执行“Play 示例”

在新文件夹中运行“sbt sbt-version”时,我获得:
[info] Set current project to default-85f41b (...)
[info] 0.12.1

最佳答案

如果你看 project/plugins.sbt ,你会看到它期望 play.version要设置的系统属性:

addSbtPlugin("play" % "sbt-plugin" % Option(System.getProperty("play.version")).getOrElse("2.0"))

因此,您应该提供必要的 play.version属性(property)
$ sbt -Dplay.version=2.1-RC1

或者干脆改 plugins.sbt作为
addSbtPlugin("play" % "sbt-plugin" % "2.1-RC1")

关于scala - Unresolved 依赖 SBT org.scala-sbt#sbt_2.9.1;0.12.1 : not found, Play 示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13737926/

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