2012-10-12 41 views
2

我使用Maven編碼gwt 2.4應用程序。該項目分爲幾個(Maven)子項目。 gwt maven插件用於構建項目。雖然構建自身運行良好,我運行到的問題與GwtTests:Maven + GWTTestCase + Test =>沒有源代碼可用於類型nnn(依賴項)

[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 

這些測試可以使用Eclipse中運行方式GWT單元測試運行 - 但是,我想這樣做,使用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> 

你爲什麼Maven是缺少來源的測試,同時使用「時間在編譯(MVN安裝)是不是一個問題?我該如何解決這個問題?

由於提前, 格爾茨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> 

所有必需的模塊繼承。

回答

0

Gwt需要所有需要的java源代碼。你必須打包它們。見Multi-Project Setup

+0

嗯......我知道GWT需要的所有Java源代碼 - 提供「時間其實什麼行家做的是,做一個GWT時建立。但是,我沒有看到它們在編譯/安裝過程中可用的原因,但在執行測試時卻沒有。 – yanosz

相關問題