Vin*_*nki 3 java eclipse eclipse-plugin playframework sbteclipse
我是 Play 框架的新手。我按照这个链接安装成功,但现在我想在 Eclipse 上集成项目。我查看了play的官方链接,但我不明白该写在哪里
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
Run Code Online (Sandbox Code Playgroud)
和其他步骤。
我正在使用 Mac Os X 和 Eclipse Luna。
您需要将其写入“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)
Run Code Online (Sandbox Code Playgroud)
更新
@mkruz也给出了很好的建议:
使用文本编辑器并如上所述进行修改
project/plugins.sbt,build.sbt然后运行activator eclipse或sbt eclipse。然后您应该能够通过以下方式在 Eclipse 中导入项目File -> Import -> Existing Projects into Workspace