有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

eclipse for Play框架中的java设置sbteclipse

我是一个新手。接下来是这个link,安装成功,但现在我想在eclipse上集成这个项目。我从游戏中观看了official link,但我不知道该在哪里写作

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

以及其他步骤

我正在使用Mac Os X和Eclipse Luna


共 (1) 个答案

  1. # 1 楼答案

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

    enter image description here

    顺便说一句,如果您计划只使用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也给出了很好的建议:

    Use a text-editor and modify project/plugins.sbt and build.sbt like described above and then run activator eclipse or sbt eclipse. You should then be able to import the project in Eclipse via File -> Import -> Existing Projects into Workspace