mvn集成测试-can';t find myproject.gwt.xml以运行GwtTest*.java测试用例
我正在构建一个GWT项目,在执行GwtTest*.java单元测试时遇到问题。我可以在开发者模式下运行这个项目(mvngwt:run)。但是,当我使用“mvn集成测试”或“mvn gwt:test”运行单元测试时,我收到以下错误mvn集成测试-can';t find myproject.gwt.xml以运行GwtTest*.java测试用例,gwt,maven,Gwt,Maven,我正在构建一个GWT项目,在执行GwtTest*.java单元测试时遇到问题。我可以在开发者模式下运行这个项目(mvngwt:run)。但是,当我使用“mvn集成测试”或“mvn gwt:test”运行单元测试时,我收到以下错误 Loading inherited module 'com.mycompany.site.client.myproject' [ERROR] Unable to find 'com/mycompnay/site/client/myproject.gwt.xml'
Loading inherited module 'com.mycompany.site.client.myproject'
[ERROR] Unable to find 'com/mycompnay/site/client/myproject.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
下面是我的pom.xml
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!-- POM file generated with GWT webAppCreator -->
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<artifactId>myproject</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>GWT Maven Archetype</name>
<properties>
<!-- Convenience property to set the GWT version -->
<gwtVersion>2.4.0</gwtVersion>
<!-- GWT needs at least java 1.5 -->
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwtVersion}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
<classifier>sources</classifier>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<!-- Generate compiled stuff in the folder used for developing mode -->
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
<plugins>
<!-- GWT Maven Plugin -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.4.0</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test</goal>
<goal>i18n</goal>
<goal>generateAsync</goal>
<goal>mergewebxml</goal>
</goals>
</execution>
</executions>
<!-- Plugin configuration. There are many available options, see
gwt-maven-plugin documentation at codehaus.org -->
<configuration>
<runTarget>myproject.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<i18nMessagesBundle>com.mycompany.site.client.Messages</i18nMessagesBundle>
</configuration>
</plugin>
<!-- Copy static web files before executing gwt:run -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1.1</version>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
<configuration>
<webappDirectory>${webappDirectory}</webappDirectory>
</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>
</project>
4.0.0
com.mycompany
我的项目
战争
0.0.1-快照
GWT Maven原型
2.4.0
${project.build.directory}/${project.build.finalName}
UTF-8
com.google.gwt
gwt servlet
${gwtVersion}
运行时
com.google.gwt
gwt用户
${gwtVersion}
假如
朱尼特
朱尼特
4.7
测试
javax.validation
验证api
1.0.0.GA
测试
javax.validation
验证api
1.0.0.GA
来源
测试
${webappDirectory}/WEB-INF/classes
org.codehaus.mojo
GWTMaven插件
2.4.0
编译
测试
i18n
生成同步
合并WebXML
myproject.html
${webappDirectory}
com.mycompany.site.client.Messages
org.apache.maven.plugins
maven战争插件
2.1.1
编译
爆炸了的
${webappDirectory}
org.apache.maven.plugins
maven编译器插件
2.3.2
1.5
1.5
在使用GWTMaven原型创建GWT项目时,我使用的是maven生成的默认项目结构。因此,我的myproject.gwt.xml位于src/main/resources/com/mycompany/site/myproject.gwt.xml中。在此问题上的任何帮助都将不胜感激。我解决了我的问题。我不明白应该从哪里归还
public String getModuleName() { . . . }
我最初是返回入口点类的路径,但是您应该返回gwt.xml文件的路径。我也不明白“模块”指的是什么