Play:Eclipse不解析PlayEbean Package

时间:2015-10-29 21:12:39

标签: java eclipse playframework

我有一个Play Framework项目,其中包含plugins.sbt中的Ebean lib:

addSbtPlugin("com.typesafe.sbt" % "sbt-play-ebean" % "1.0.0")

并在build.sbt中启用它:

lazy val root = (project in file(".")).enablePlugins(PlayJava, PlayEbean)

然后我运行activator eclipse并且play-ebean jar在项目中。然后我将包导入一个类:

import play.db.ebean.model;

Play本身似乎很满意,但Eclipse将其标记为未解决的依赖。

有关Eclipse配置中缺少的内容的任何提示吗?

1 个答案:

答案 0 :(得分:0)

尝试添加到build.sbt下一个设置:

// Eclipse settings

// 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)

// End of eclipse settings

那帮助了我