3

Im using play 2.0 and trying to modularize the project into a subproject. In $project_home, created folder structure ${project_home}/data/app/models/MyModel.java

The Build.scala looks

val dataDependencies = Seq(
)

val dataProject = PlayProject(appName + "-data", appVersion, dataDependencies, path = file("data"), mainLang = JAVA)

val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
  // Add your own project settings here      
).dependsOn(dataProject).aggregate(dataProject)

I run a play eclpsify command.

In eclipse, I've imported two projects, the main project and the data project.

The data project shows the following error

Project '-data' is missing required library: '/path/to/myprojects/data/target/scala-2.9.1/classes_managed'

What am I doing wrong here? Any help would be appreciated

4

6 回答 6

8

这对我有用(在 Windows 上)。

  1. 编辑.classpath,应该有一个类似这样的条目: <classpathentry path="D:\your_play_project_folder\target\scala-2.10\classes_managed" kind="lib"></classpathentry>

  2. 删除“目标”之前的路径部分以获得此: <classpathentry path="target\scala-2.10\classes_managed" kind="lib"></classpathentry>

  3. 刷新 Eclipse。

于 2013-02-17T17:56:23.750 回答
3

我在使用 play 2.0.2 构建项目时遇到了类似的问题我手动创建了文件夹并在 eclipse 中target/scala-2.9.1/classes_managed运行项目clean all

我希望它有帮助

于 2012-07-17T16:04:38.280 回答
2

我认为你有3种可能性:

  1. 手动创建 data/target/scala-2.9.1/classes_managed。

  2. 从类路径中删除路径(如果没有必要)

  3. 切换到 2.1 快照
于 2012-05-27T05:47:41.553 回答
2

对我有帮助:

  1. 从 .classpath 文件中手动删除 target/scala-2.9.1/classes_managed
  2. 通过 eclipse 添加了 target/scala-2.9.1/classes_managed: project/properties/Java Build Path --> tab Libraries --> Add Class Folder...
于 2012-12-17T23:00:07.707 回答
1

尝试“play clean”然后“play eclipse”,从项目基础文件夹中的命令提示符重新生成 eclipse 项目文件。

于 2013-08-24T17:26:14.417 回答
0

尝试这个:

1) sbt> clean/compile in parent, followed by child project
2) add target/src-managed/main as source folder in eclipse, both projects
3) in child
java build path > projects > (add parent)
project references > (add parent)

顺便说一句,dataProject 做什么?我的基础项目提供了一个 DAO 层和其他与 Play 无关的细节;因此,我只是将它定义为一个根 sbt 项目,并通过dependsOn(root)

无论如何,希望这能解决问题......

于 2012-05-26T08:05:41.063 回答