【问题标题】:error: eof expected?! How to use idea and eclipse plugins together in sbt?错误:预期的eof?!如何在sbt中同时使用idea和eclipse插件?
【发布时间】:2013-12-29 22:24:05
【问题描述】:

我使用 sbt 0.13

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

有趣的是,两条线是分开工作的。

是否可以同时使用这两个插件?

【问题讨论】:

    标签: sbt


    【解决方案1】:

    根据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")
    

    请注意,对于 sbteclipse 2.3.0,您需要 SBT 0.13.0,而 sbt-idea 目前适用于 SBT 0.12.x

    【讨论】:

      猜你喜欢
      • 2012-03-17
      • 1970-01-01
      • 2018-05-13
      • 2014-11-14
      • 1970-01-01
      • 2015-02-26
      • 2013-01-22
      • 2015-09-07
      • 2015-01-12
      相关资源
      最近更新 更多