Gwt编译错误: unable to find entry point when it's not in src/main/java

标签 gwt compilation entry-point

我编译应用程序时出错:

[INFO] Compiling module com.mycompany.myapp.MyAppMocked
[INFO]    Finding entry point classes
[INFO]       [ERROR] Unable to find type 'com.mycompany.myapp.client.mock.MockEntryPoint'
[INFO]          [ERROR] Hint: Check that the type name 'com.mycompany.myapp.client.mock.MockEntryPoint' is really what you meant
[INFO]          [ERROR] Hint: Check that your classpath includes all required source roots

在我的 .gwt.xml 中,我有:

<entry-point class="com.mycompany.myapp.client.mock.MockEntryPoint" />

当我将 MockEntryPoint.java 放在 src/mocked/java 而不是 src/main/java 中时,就会出现问题。

在编译“no-mock”版本时,我需要两个目录来排除 src/mocked/java 中的所有内容。

如果我将 MockEntryPoint.java 移至 src/main/java,编译将成功且不会出现错误。在这两种情况下,类 MockEntryPoint 都位于包“com.mycompany.myapp.client.mock”中。

如何告诉 gwt 在 src/mocked/java 中查找我的入口类?

最佳答案

假设这是一个 Maven 项目,您需要添加 src/mocked/java 作为源文件夹。在 Maven 中,必须使用 build-helper-maven-pluginadd-source 来完成。魔力。


但是几乎没有理由拥有 src/mocked 层次结构:

  • 您可以将所有内容放入 src/main 中,然后编译您需要/想要的 GWT 模块(设置 modulemodules 配置属性相应的 gwt-maven-plugin)
  • 如果您希望它们清晰分开,Maven 希望您使用不同的 Maven 模块/项目。你不想与 Maven 对抗。

关于Gwt编译错误: unable to find entry point when it's not in src/main/java,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22982516/

相关文章:

gwt - 项目的输出目录应设置为/gwtproject/src/main/webapp/WEB-INF/classes

GWT/JSNI - "DataCloneError - An object could not be cloned"- 如何调试?

eclipse - 如何在 GWT 中调试 JSNI 方法?

c - 如何在Mac OS X的C程序中包含hdf5头文件?

shell - 如何使 docker 入口点仅针对某些特定命令以非 root 身份运行

java - 如果我将 RootPanel 更改为 RootLayoutPanel,我的浏览器将忽略 slider 。为什么?

linux - Ubuntu 14.04 - 内核无法使用 make-kpkg 编译

windows - 如何从命令提示符编译多种语言?

c++ - 在 C++ 项目中找不到程序入口点

C:如何实现动态函数复制?