[英]Maven + GWTTestCase + Test => No source code is available for type nnn (of dependency)
我正在使用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
可以使用“運行方式GWT單元”測試在Eclipse中運行這些測試-但是,我想使用Maven這樣做,以便在Jenkins上運行'em。
重要說明 :所有丟失的源文件都是不同的子對象。 它們不包含在我要構建的項目中。 它們被定義為項目依賴項,並在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>
您為什么在編譯中使用'em(mvn install)時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>
所有必要的模塊均被繼承。
Gwt需要所有必需的Java源。 您必須打包。 請參閱多項目設置
您需要繼承.gwt.xml
的模塊
請參閱: http : //code.google.com/p/google-web-toolkit-doc-1-5/wiki/DevGuideModules
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.