没有可用于类型 <type> 的源代码.您是否忘记继承所需的模块? [英] No source code is available for type <type> did you forget to inherit a required module?

查看:79
本文介绍了没有可用于类型 <type> 的源代码.您是否忘记继承所需的模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的项目拆分为 4 个 Java 模块:

I am trying to split my project into 4 Java modules:

web-client
web-client-admin
web-client-landing
web-client-core

模块 web-client 是将所有部分组合在一起的模块,因此依赖关系树看起来像这样:

The module web-client is the one that puts all pieces together, so the dependency tree would look something like this:

                <-- web-client-admin <----
               /                          \ 
web-client <---                            <---- web-client-core
               \                          /
                <-- web-client-landing <--

在我的 module.gwt.xml 中,我有:

<inherits name="com.mz.client.application.landing" />
<inherits name="com.mz.client.application.admin" />
<inherits name="com.mz.client.application.core" />

和java模块在web-client模块的pom.xml中:

and the java modules are in the pom.xml of the web-client module:

    <dependency>
        <groupId>com.mz</groupId>
        <artifactId>mz-web-client-admintool</artifactId>
        <version>0.1-SNAPSHOT</version>
    </dependency>
    <dependency>
        <groupId>com.mz</groupId>
        <artifactId>mz-web-client-landing</artifactId>
        <version>0.1-SNAPSHOT</version>
    </dependency>

但是,我得到:

[INFO]       Compiling module com.mz.client.ClientEntryPoint
[INFO]          Tracing compile failure path for type 'com.mz.client.application.ApplicationBootstrapper'
[INFO]             [ERROR] Errors in 'file:/E:/java/mz/mz-server/mz-web-client/src/main/java/com/mz/client/application/ApplicationBootstrapper.java'
[INFO]                [ERROR] Line 144: No source code is available for type com.mz.client.application.core.network.ParallelRequest.ParallelCallback; did you forget to inherit a required module?
[INFO]                [ERROR] Line 77: No source code is available for type com.mz.client.application.core.dao.app.ApplicationData; did you forget to inherit a required module?
[INFO]                [ERROR] Line 103: No source code is available for type com.mz.client.application.core.network.XsrfRequest<S,R>; did you forget to inherit a required module?
[INFO]                [ERROR] Line 144: No source code is available for type com.mz.client.application.core.dao.shop.ShopAdmin; did you forget to inherit a required module?
[INFO]                [ERROR] Line 49: No source code is available for type com.mz.client.application.core.LogMessageFormatter; did you forget to inherit a required module?
[INFO]          Tracing compile failure path for type 'com.mz.client.application.ApplicationModule'
[INFO]             [ERROR] Errors in 'file:/E:/java/mz/mz-server/mz-web-client/src/main/java/com/mz/client/application/ApplicationModule.java'
[INFO]                [ERROR] Line 18: No source code is available for type com.mz.client.application.landing.LandingModule; did you forget to inherit a required module?
[INFO]                [ERROR] Line 20: No source code is available for type com.mz.client.application.admin.AdminToolModule; did you forget to inherit a required module?
[INFO]          Tracing compile failure path for type 'com.mz.client.application.login.LoginPresenter'
[INFO]             [ERROR] Errors in 'file:/E:/java/mz/mz-server/mz-web-client/src/main/java/com/mz/client/application/login/LoginPresenter.java'
[INFO]                [ERROR] Line 124: No source code is available for type com.mz.client.application.core.event.AdminLoginEvent; did you forget to inherit a required module?
[INFO]                [ERROR] Line 75: No source code is available for type com.mz.client.application.core.network.Request<R>; did you forget to inherit a required module?
[INFO]                [ERROR] Line 112: No source code is available for type com.mz.client.application.core.dao.shop.ShopAdmin; did you forget to inherit a required module?
[INFO]                [ERROR] Line 112: No source code is available for type com.mz.client.application.core.network.ParallelRequest.ParallelCallback; did you forget to inherit a required module?
[INFO]          [ERROR] Aborting compile due to errors in some input files

我不明白我在这里缺少什么..

I don't see what I am missing here..

推荐答案

您要么需要将源文件作为资源包含到您的模块中,要么将依赖项添加到除 jar 之外的源工件.

You either need to include source files as resources into your modules, or add dependencies to the sources artifacts in addition to the jar ones.

鉴于这些都是客户端模块,我宁愿将源代码包含在 JAR 中.

Given that these are all client modules, I'd rather include the sources into the JARs.

您可以简单地将 src/main/java 声明为附加的 ,或者您可以使用 gwt-maven-plugin(也许看看https://tbroyer.github.io/gwt-maven-plugin/ gwt-lib 包装;免责声明:我是作者)

You can simply declare src/main/java as an additional <resource>, or you can use a gwt-maven-plugin (maybe have a look at https://tbroyer.github.io/gwt-maven-plugin/ gwt-lib packaging; disclaimer: I'm the author)

这篇关于没有可用于类型 &amp;lt;type&gt; 的源代码.您是否忘记继承所需的模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆