2012-12-06 48 views
7

我试图在游戏运行样品2.0框架,但是当我去跑“玩”或“SBT”。未解决的依赖SBT org.scala-SBT#sbt_2.9.1; 0.12.1:没有发现,播放的例子

当我去到目录 “/样品/斯卡拉/ 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的“Launcher”版本有关,我怎么知道哪个是我的Launcher sbt版本?我该如何更新它?

我也试图从源代码编译xsbt但是,运行“SBT集结所有”的时候,我得到:

. . . 
[info] Reading library jar [C:\compi\jdk\jre\lib\rt.jar] 
[error] Error: Can't read [[email protected]] (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-版”我获得:

[info] Set current project to default-85f41b (...) 
[info] 0.12.1 

回答

6

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

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

所以,您应该提供必要的play.version财产

$ sbt -Dplay.version=2.1-RC1 

或简单地改变plugins.sbt作为

addSbtPlugin("play" % "sbt-plugin" % "2.1-RC1") 
+0

我做到了,但还没有成型。它返回:[info]从C:\ src \ Play20 \ samples \ scala \ helloworld \ project加载项目定义 [error] C:\ src \ Play20 \ samples \ scala \ helloworld \ project \ Build.scala:2:not找到:object keys [error] import keys._ [error]^ [error]发现一个错误 [error](compile:compile)编译失败 – Labra

+0

我只能建议清理项目并重试。 – 4e6

+0

你的意思是执行“sbt clean”吗?因为我得到同样的错误。我正在寻找一些帮助,我可以找到与Scala版本相关的东西,但我不确定这是否是问题。我的Scala版本是2.9.2。我应该如何清理该项目并重试? – Labra

2

我已经切换到后解决了这个问题播放2.1-RC1

我也有一个问题与一些依赖它解决了我插入:在plugins.sbt

// The Typesafe snapshots repository 
resolvers += "Typesafe Snapshots" at "http://repo.typesafe.com/typesafe/snapshots/" 

我只是以下几点:https://github.com/playframework/Play20/wiki/Repositories

1

对于发挥2.0.2,版本SBT的2.0.2只是工作在我的项目中很好。我改变了addSbtPlugin线在我plugins.sbt文件:

addSbtPlugin("play" % "sbt-plugin" % "2.0.2") 

它应该是早期版本类似。正如拉夫拉已经指出,因为这个版本的SBT的是不是最新的了,你可能还需要添加以下解析器,为了获得它:

resolvers += "Typesafe Snapshots" at "http://repo.typesafe.com/typesafe/snapshots/" 

摆脱这类问题的另一种方式正在更新播放框架为您的项目到最新版本,如果可能的。这可能是从长远来看,最好的选择,因为它可以让你保持你的代码基极电流。

4

对于激活1.0用户

您可以后升级播放项目到更高版本当遇到这样的问题,你的项目加载到激活1.0。这是因为Activator在/ project目录中创建了类似activator-...-shim.sbt的文件。删除这些文件,Activator应该在下次编译时解决这个问题。

+0

谢谢发布这个。我花了数小时试图弄清楚为什么我在获得错误之前尝试了许多不同的sbt/play版本组合。 – eSniff

0

继圣何塞的答案,我做了工作,但与此解析器:

"Typesafe Snapshots" at "http://repo.typesafe.com/typesafe/maven-releases" 
相关问题