我正在使用 Maven 编写一个 gwt 2.4 应用程序。该项目分为几个(Maven)子项目。gwt maven 插件用于构建项目。虽然构建本身运行良好,但我遇到了 GwtTests 的问题:
[INFO] [ERROR] Errors in 'file:/Users/yanosz/app/gwt-app/src/test/java/com/company/gwt-app/ui/ng/gwt/screen/impl/s0A5/GwtTestValidationMeldung.java'
[INFO] [ERROR] Line 59: No source code is available for type com.company.commons.gwt.types.LogicalDate; did you forget to inherit a required module?
[INFO] [ERROR] Line 61: No source code is available for type com.company.commons.gwt.types.JaNeinType; did you forget to inherit a required module?
[INFO] [ERROR] Line 98: No source code is available for type com.company.ui.ng.gwt.screen.layout.messages.MessageAreaDisplay; did you forget to inherit a required module?
[INFO] [ERROR] Line 101: No source code is available for type com.company.ui.ng.gwt.screen.support.gwt-appD.ialogYesNoCallback; did you forget to inherit a required module?
[INFO] [ERROR] Line 111: No source code is available for type com.company.ui.ng.gwt.infrastructure.scheduler.SchedulerSimple; did you forget to inherit a required module?
[INFO] [ERROR] Line 138: No source code is available for type com.company.commons.gwt.ui.UIProperties; did you forget to inherit a required module?
[INFO] [ERROR] Line 143: No source code is available for type com.company.ui.ng.gwt.screen.support.editor.EditorValidationType; did you forget to inherit a required module?
(....)
[INFO] [ERROR] Unable to find type 'com.company.ui.ng.gwt.screen.impl.s0A5.GwtTestValidationMeldung'
[INFO] [ERROR] Hint: Previous compiler errors may have made this type unavailable
这些测试可以使用Run As GWT 单元测试在 Eclipse 中运行- 但是,我想使用 Maven 这样做以便在 Jenkins 上运行它们。
重要说明:所有丢失的源文件都是部分不同的子 probjects。它们不包含在我正在尝试构建的项目中。它们被定义为项目依赖项,并在 compileSourcesArtifacts 语句中提到:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.4.0</version>
<executions>
<execution>
<phase>prepare-package</phase>
<goals>
<goal>compile</goal>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<module>${gwt.module}</module>
<style>${gwt.style}</style>
<runTarget>GwtApp.html</runTarget>
<compileSourcesArtifacts>
<compileSourcesArtifact>com.company.gwt-app:gwt-app-commons</compileSourcesArtifact>
<compileSourcesArtifact>com.company.gwt-app:gwt-app-ui</compileSourcesArtifact>
</compileSourcesArtifacts>
</configuration>
</plugin>
你为什么在编译(mvn install)中使用'em时Maven在测试中缺少源不是问题?我该如何解决?
在此先感谢, Greetz yanosz
编辑:我的测试的模块配置是:
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='gwt-app'>
<inherits name='com.company.gwt-app.commons.Module' />
<inherits name='com.company.gwt-app.ui.ng.Module' />
<inherits name="com.google.gwt.i18n.I18N" />
<entry-point class="com.company.gwt-app.ui.ng.gwt.application.gwt-appEntryPoint" />
<source path='gwt' />
<!-- German language, independent of country -->
<set-property name="locale" value="de" />
<set-property-fallback name="locale" value="de" />
<extend-property name="locale" values="en" />
</module>
所有必要的模块都被继承。