Maven + GWTTestCase + Test =>没有源代码可用于类型nnn(依赖)

时间:2012-10-12 17:23:27

标签: java gwt maven

我正在使用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 Unit测试在eclipse中运行 - 但是,我想使用Maven在Jenkins上运行它们。

重要说明:所有缺少的源文件都是不同的子项目。它们不包含在我正在尝试构建的项目中。它们被定义为项目依赖项,并在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>

为什么Maven在测试中缺少源代码而在编译时使用'em(mvn install)不是问题?我该如何解决这个问题?

提前致谢, 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>

继承所有必要的模块。

2 个答案:

答案 0 :(得分:0)

Gwt需要所有需要的java源代码。你必须收拾它们。见Multi-Project Setup

答案 1 :(得分:0)

您需要继承.gwt.xml

中的模块

请参阅:http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/DevGuideModules