2013-08-25 30 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

相关问题