我使用New-> Project-> Maven project-> GWT Eclipse插件在Eclipse中创建了一个GWT Maven项目。它已创建,但它会出现一些错误,如
The output directory for the project should be set to /gwtproject/src/main/webapp/WEB-INF/classes
配置项目时是否有任何遗漏?
我的pom.xml包括:
<build>
<!-- Generate compiled stuff in the folder used for developing mode -->
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<versionRange>[2.4.0,)</versionRange>
<goals>
<goal>resources</goal>
<goal>compile</goal>
<goal>i18n</goal>
<goal>generateAsync</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<versionRange>[2.1.1,)</versionRange>
<goals>
<goal>exploded</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
答案 0 :(得分:6)
解决这个问题的一个非常好的解决方案是:
更改默认输出文件夹
质疑你在Eclipse中做出的生活决定。
答案 1 :(得分:1)
您应该使用GWT文章WorkingWithMaven - http://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven
进行预先检查另请参阅GWT示例项目Validation,DynaTableRf和MobileWebApp。
答案 2 :(得分:0)
您需要在pom中的<webappDirectory>
标记中配置缺少的部分。我认为这可以解决您的问题:Click Here