2016-03-23 25 views
2

我是Play框架中的新手。我跟着这个link,安装成功,但现在我想在Eclipse上集成项目。我查看了official link从播放,但我不明白在哪里写在eclipse中为播放框架设置sbteclipse

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

和其他步骤。

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

+0

我建议使用IntelliJ IDE。你应该更频繁地查看游戏文档。在那里你可以找到解决方案更容易(滚动链接到最后看到答案).https://www.playframework.com/documentation/2.6.x/BuildOverview – Fenici

+0

thanx为您的答复,但问题是太后,我移动在Spring Boot中,并乐意使用Spring启动 –

+0

呵呵〜没有意识到,但是现在没有太多人在使用play,社区并不是真正活跃的 – Fenici

回答

3

你需要把它写在“项目\ 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) 

UPDATE

@mkruz给了一个很好的建议,以及:

使用文本编辑器和修改上述project/plugins.sbtbuild.sbt 像描述,然后运行activator eclipsesbt eclipse。 然后,您应该可以通过导入Eclipse项目 File -> Import -> Existing Projects into Workspace

+0

但是如何在eclipse中导入播放项目? –

+1

使用文本编辑器并像上面描述的那样修改'project/plugins.sbt'和'build.sbt',然后运行'activator eclipse'或'sbt eclipse'。然后,您应该可以通过'File' - >'Import' - >'Existing Projects into Workspace'在Eclipse中导入项目。 – mkurz

+0

感谢这一点,Play文档在这一点上有点含糊,但这让我走了! –