sbt - 错误 : eof expected?!如何在sbt中一起使用idea和eclipse插件?

标签 sbt

我使用 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

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

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

最佳答案

根据 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-idea 目前用于 SBT 0.12.x .

关于sbt - 错误 : eof expected?!如何在sbt中一起使用idea和eclipse插件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18432683/

相关文章:

sbt - 如何使用SBT配置元空间

scala - 设置 sbt 程序集 v0.14.2 时出现问题

scala - Atlassian Bamboo 5.x 是否与 Play Framework 2.x 兼容

scala - 将当前项目设置为 default-6c6f02(在构建文件 :/home/user_name/Videos/中

scala - 为什么使用fish时sbt会退出?

使用 JOOQ 生成器的 Playframework Evolutions

java - 如何将 JDK 中的类链接到 scaladoc 生成的文档中?

scala - Sbt 依赖运行测试

scala - 从 build.sbt 读取 application.conf

scala - 无法在 Windows 上使用 0.13.1 为对象堆保留足够的空间?