首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 ><type>类型没有可用的源代码,您忘记继承所需的模块了吗?

<type>类型没有可用的源代码,您忘记继承所需的模块了吗?
EN

Stack Overflow用户
提问于 2016-05-21 16:27:33
回答 1查看 4.7K关注 0票数 0

我试图将我的项目分成4个Java模块:

代码语言:javascript
复制
web-client
web-client-admin
web-client-landing
web-client-core

模块web-client将所有的部件组合在一起,因此依赖树看起来如下所示:

代码语言:javascript
复制
                <-- web-client-admin <----
               /                          \ 
web-client <---                            <---- web-client-core
               \                          /
                <-- web-client-landing <--

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

代码语言:javascript
复制
<inherits name="com.mz.client.application.landing" />
<inherits name="com.mz.client.application.admin" />
<inherits name="com.mz.client.application.core" />

java模块位于web-client模块的web-client中:

代码语言:javascript
复制
    <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>

然而,我得到的是:

代码语言:javascript
复制
[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

我看不出我在这里错过了什么。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-05-21 20:51:16

您需要将源文件作为资源包含到模块中,或者将依赖项添加到源工件以及jar工件中。

考虑到这些都是客户端模块,我宁愿将源代码包含到JAR中。

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

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37365459

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档