错误:eof 预期?!如何在sbt中一起使用idea和eclipse插件? [英] error: eof expected?! How to use idea and eclipse plugins together in sbt?

查看:39
本文介绍了错误:eof 预期?!如何在sbt中一起使用idea和eclipse插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 sbt 0.13.

https://github.com/typesafehub/sbteclipsehttps://github.com/typesafehub/sbt-idea 建议为 ~/.sbt/plugins/build.sbt 添加一行.

Both https://github.com/typesafehub/sbteclipse and https://github.com/typesafehub/sbt-idea suggest to add a line for each to ~/.sbt/plugins/build.sbt.

因此我的 plugins/build.sbt 看起来像:

Thus my plugins/build.sbt looks like:

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

这样,sbt 不断失败并出现错误:

With that, sbt keeps failing with the error:

.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

有趣的是,两条线是分开运作的.

Interestingly, both lines work seperately.

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

Is it possible to use both plugins?

推荐答案

根据 build.sbt 如何定义设置 你需要在 Scala 表达式之间放一个空行.

According to How build.sbt defines settings you need to put a blank line between Scala expressions.

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.

Note that you need SBT 0.13.0 for sbteclipse 2.3.0 and sbt-idea is currently for SBT 0.12.x.

这篇关于错误:eof 预期?!如何在sbt中一起使用idea和eclipse插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆