如何在没有EntryPoint的情况下编译模块?
我有一个GWT的实用程序模块,它没有UI(因此,没有类继承自 com.google.gwt.core.client.EntryPoint
。当我尝试使用GWT 1.7.1编译此模块时,出现此错误:
I have a utility module for GWT which doesn't have an UI (hence, there is no class which inherits from com.google.gwt.core.client.EntryPoint
. When I try to compile this module with GWT 1.7.1, I get this error:
[ERROR] Module has no entry points defined
我如何摆脱这个错误?我真的必须定义一个虚拟条目点?Google是如何编译它们自己的实用程序模块的?
How do I get rid of this error? Do I really have to define a dummy entry point? How did Google ever compile their own utility modules???
我使用 gwt-maven-plugin
Maven2插件来编译我的代码,我从老版本的 maven-googlewebtoolkit2-plugin
插件迁移了代码。旧插件,我必须指定哪些模块是入口点,如下所示:
I'm using the gwt-maven-plugin
Maven2 plugin to compile my code. I migrated the code from an old version of the maven-googlewebtoolkit2-plugin
plugin. For the old plugin, I had to specify which modules were entry points like so:
<compileTargets>
<param>com.project.module.Module</param>
</compileTargets>
对于新插件,它是
For the new plugin, it's
<module>com.project.module.Module</module>
由于插件找不到要编译的模块,因此它会搜索* .gwt.xml 并将它们全部编译成UI模块(它必须有一个入口点)。
Since the plugin couldn't find which modules to compile, it search for "*.gwt.xml" and compiled all of them into "UI modules" (which must have an entry point).