2012-12-06 49 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" 
相關問題