我正在尝试使用 Eclipse 和 Scala 构建一个简单的 Akka 程序。我使用 g8 和 Akka(g8 typesafehub/akka-scala-sbt) 创建 sbt 项目,然后使用 sbteclispe 创建 Eclipse 项目。当我将项目导入 Eclipse 时,出现错误,提示我缺少 Akka。有什么方法可以使用 Eclipse 构建 Akka 项目吗?
最佳答案
最简单的事情是将 sbteclipse
插件添加到您的 Sbt 构建中。它会自动为 Eclipse 生成项目文件,以便您可以导入项目及其所有设置(包括类路径)。为此,请在 project/plugins.sbt
下添加以下内容(不是在项目的根目录中,而是在 project
子目录下):
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0")
然后,启动sbt
并在提示符处写入eclipse
。您应该看到:
> eclipse
[info] About to create Eclipse project files for your project(s).
[info] Successfully created Eclipse project files for project(s):
[info] Test Project
然后转到 Eclipse 并导入您的项目。
关于eclipse - 使用 Eclipse 设置 Akka,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12612287/