2

我是 Play 框架的新手。我跟着这个链接,安装成功,但现在我想在eclipse上集成项目。我从play中查看了官方链接,但我不明白在哪里写

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")

和其他步骤。

我正在使用 Mac Os X 和 Eclipse Luna。

4

1 回答 1

4

您需要将其写入“project\plugins.sbt”文件中:

在此处输入图像描述

顺便说一句,如果您打算只使用 java(正如我从标签中看到的那样),那么您也可以将此行添加到“build.sbt”文件中:

// Compile the project before generating Eclipse files,
// so that generated .scala or .class files for views and routes are present
EclipseKeys.preTasks := Seq(compile in Compile)

// Java project. Don't expect Scala IDE
EclipseKeys.projectFlavor := EclipseProjectFlavor.Java

// Use .class files instead of generated .scala files for views and routes
EclipseKeys.createSrc := EclipseCreateSrc.ValueSet(EclipseCreateSrc.ManagedClasses, EclipseCreateSrc.ManagedResources)

更新

@mkruz也给出了很好的建议:

使用文本编辑器并修改project/plugins.sbtandbuild.sbt 如上所述,然后运行activator eclipse​​or sbt eclipse。然后,您应该能够通过以下方式在 Eclipse 中导入项目 File -> Import -> Existing Projects into Workspace

于 2016-03-23T12:12:03.857 回答