我用mvn原型创建了一个GWT项目:生成-DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.5.0。
导入了eclipse中的项目。
我得到的第一个错误是:未被生命周期配置覆盖的插件执行:org.codehaus.mojo:gwt plugin:2.5.0:i18n (执行:默认,阶段:生成-源)
在pom文件中。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
<goal>i18n</goal>
<goal>generateAsync</goal>
</goals>
</execution>
</executions>
<!-- Plugin configuration. There are many available options, see
gwt-maven-plugin documentation at codehaus.org -->
<configuration>
<runTarget>dashboard.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<i18nMessagesBundle>com.farheap.jsi.dashboard.client.Messages</i18nMessagesBundle>
</configuration>
此外,代码还包含一个找不到的GreetingServiceAsync。
private final GreetingServiceAsync greetingService = GWT.create(GreetingService.class);发布于 2013-06-01 01:35:40
你有两个选择:
mvn gwt:i18n。您可以为它创建一个方便的短道发射器。Eclipse会记住您要忽略的决策,它会将其永久存储到项目的.settings目录中。在典型的开发过程中,本地化消息不会经常更改,所以第二个选项通常更方便,并且加快了构建。
这适用于大多数GWT插件的目标!即使是GWT编译也很少有必要,因为DevMode直接使用JavaScrips代码,而不是生成JavaScrips。因此,在实践中,您必须在开始时至少调用所有目标一次,然后在没有目标的情况下使用几周;基本的Eclipse编译就足够了。
如果以后决定在实际应用程序中不使用GWT本地化框架,那么可以从POM中完全删除目标i18n。调用目标i18n生成(vanilla) Sample.java所需的文件{project}/target/generated-sources/gwt/my/code/client/Messages.java。
此外,代码还包含一个找不到的GreetingServiceAsync。
从命令行或mvn install菜单运行build Eclipse Run as -> Maven install。在命令行的情况下,mvn gwt:generateAsync应该足够了。这个目标会生成{project}\target\generated-sources\gwt\my\code\client\GreetingServiceAsync.java,而这正是您所缺少的。Eclipse没有自动为您做这件事,因为它被以前的i18n问题所阻止,生命周期配置没有涵盖它。所以是的,你提到的问题是相关的。
https://stackoverflow.com/questions/14886380
复制相似问题