在最近发布 2.4.X 版本的 Play 之后,我遇到了同样的问题,并且清理/编译/重新导入的解决方案不起作用。我的解决方案是:
- 将以下键添加到 build.sbt
- 杀死日食
- ./活化剂清洁
- ./激活器编译
- ./激活器日食
- 重新导入eclipse
问题基本上是没有创建托管源目录,这些行解决了问题。
EclipseKeys.projectFlavor := EclipseProjectFlavor.Java // Java project. Don't expect Scala IDE
EclipseKeys.createSrc := EclipseCreateSrc.ValueSet(EclipseCreateSrc.ManagedClasses, EclipseCreateSrc.ManagedResources) // Use .class files instead of generated .scala files for views and routes
EclipseKeys.preTasks := Seq(compile in Compile) // Compile the project before generating Eclipse files, so that .class files for views and routes are present