gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 09:10:14 26 4
gpt4 key购买 nike

我正在使用 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

这些测试可以在 eclipse 中使用 Run As GWT Unit test 运行 - 但是,我想使用 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) 不是问题?我该如何解决?

提前致谢,问候 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 源代码。你必须打包它们。参见 Multi-Project Setup

关于java - Maven + GWTTestCase + Test => 没有源代码可用于 nnn 类型(依赖项),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12864166/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com