问题描述
如何在日食中整合SBT scala?我正在关注这篇文章以及
how to integrate SBT scala in eclipse? i am following this post as well as
我想在scala中添加现有的项目。如何编译它以及如何在eclipse中使用build.sbt?
i want to add existing project in scala. how to compile it and how to use build.sbt in eclipse?
和
但没有找到任何有用的请帮助我
but not finding any useful please help me
如何使用build.sbt来编译和执行eclipse中的现有项目? / p>
how to compile and execute a existing project in eclipse using build.sbt??
推荐答案
您不能直接在Eclipse中使用build.sbt。相反,您需要使用从SBT项目生成Eclipse项目。引用README:
You can't use build.sbt in Eclipse directly. Instead you need to generate an Eclipse project from your SBT project using sbteclipse plugin. Quoting the README:
-
将sbteclipse添加到插件定义文件中。您可以使用以下两种方法之一:
Add sbteclipse to your plugin definition file. You can use either:
-
全球文件(0.13及以上版本)在〜/ .sbt / 0.13 / plugins / plugins.sbt
the global file (for version 0.13 and up) at ~/.sbt/0.13/plugins/plugins.sbt
项目特定文件在PROJECT_DIR / project / plugins.sbt
the project-specific file at PROJECT_DIR/project/plugins.sbt
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.4.0")
在sbt中使用命令eclipse创建Eclipse项目文件
In sbt use the command eclipse to create Eclipse project files
> eclipse
在Eclipse中使用导入向导将现有项目导入Workspace
In Eclipse use the Import Wizard to import Existing Projects into Workspace
有关更多使用细节,请参阅github wiki。在SBT项目中更改后,不要忘记重新运行 eclipse
命令。
See the github wiki for more usage details. Don't forget to rerun eclipse
command after changes in your SBT project.
这篇关于如何在日食中整合SBT scala的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!