2013-08-25 29 views
10

我使用sbt 0.13錯誤:eof預計?!如何在sbt中使用idea和eclipse插件?

https://github.com/typesafehub/sbteclipsehttps://github.com/typesafehub/sbt-idea均建議爲~/.sbt/plugins/build.sbt添加一行。

因此我plugins/build.sbt樣子:

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.1") 
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0") 

就這樣,SBT不斷與錯誤而失敗:

.sbt/0.13/plugins/build.sbt:2: error: eof expected but ';' found. 
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0") 
^ 
[error] Error parsing expression. Ensure that settings are separated by blank lines. 
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? zsh: exit 130 sbt 

有趣的是,這兩條線seperately工作。

是否可以使用兩種插件?

回答

19

根據How build.sbt defines settings你需要在Scala表達式之間加一個空行。

addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.5.1") 
# blank line here 
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.3.0") 

請注意,您需要SBT 0.13.0爲sbteclipse 2.3.0和SBT-理念是目前SBT 0.12.x

相關問題