GWT maven 项目从 maven 编译和 运行 但不在 eclipse 中编译和 运行

GWT maven project compiles and run from maven but don't compile and run in eclipse

我有一个多模块 maven 项目,它是用 gwt 作为主要的 web 框架构建的。 Here is github repo.

Everythink 如我所想的那样工作。我没看错。

不幸的是,当我尝试将此项目导入 eclipse(作为 maven 项目)时出现了问题。我无法编译此项目(在 Package Explorer 中的项目上使用 RMB -> Google -> GWT Compile)。

我遇到一个错误:

Loading inherited module 'src.main.resources.pl.derp.parent'
   Loading inherited module 'pl.derp.shared'
      [ERROR] Unable to find 'pl/derp/shared.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?

当我尝试在 Package Explorer -> 运行 -> 运行 项目名称上 RMB 作为 Web 应用程序(GWT 超级开发模式) 我有:

Working directory does not exist: /home/danielo/eclipseGwt/gwt_2.7.0_maven_eclipse/web/src/main/webapp

我已经添加了构建路径的模块。

我关注了这个instruction

我认为,我已尽一切努力使其发挥作用,但仍然可以使其发挥作用。

我认为问题出在包名以及 maven 和 eclipse 对待它们的方式上。他们受到不同的对待。

Maven 很容易找到每个 class (f.e.: package pl.derp.web;) 需要的并编译。 eclipse 正试图通过 f.e 找到它们。: src.main.java.pl.derp.web 但找不到。

我真的不知道如何解决这个问题? 我不确定 包名称模式更好(src.main.java.pl.derp.serverpl.derp.server)- 对我来说越短越好。

给运行maven中的这个项目(描述的很好here):

第二个 shell:

在 Eclipse 中,我认为我 运行ning 内置于 Jetty server

请帮帮我

您显然只有一个 Eclipse 项目,其中 serversharedweb 声明为源目录。使用 M2Eclipse 时,您应该有 3 个项目,每个项目的 src/{main,test}/{java,resources} 声明为源目录。至少,如果没有 M2Eclipse,源目录必须是 src/{main,test}/{java,resources},无论您有 1 个还是 3 个项目。

这就是 Eclipse 查找 src.main.java.pl.derp.server 而不是 pl.derp.server 的原因,也是 GWT 也失败的原因(类路径同样错误)。