簡體   English   中英

沒有源代碼可用於類型 <type> 您忘了繼承必需的模塊嗎?

[英]No source code is available for type <type> did you forget to inherit a required module?

我試圖將我的項目分成4個Java模塊:

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

模塊web-client是將所有部分組合在一起的模塊,因此依賴關系樹如下所示:

                <-- 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中:

    <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

我看不到我在這里想念的..

您或者需要將源文件作為資源包括在模塊中,或者除了jar之外,還對源工件添加依賴項。

鑒於這些都是客戶端模塊,我寧願將源代碼包含在JAR中。

您可以簡單地將src/main/java聲明為其他<resource> ,也可以使用gwt-maven-plugin(也許看看https://tbroyer.github.io/gwt-maven-plugin/ gwt-lib包裝;免責聲明:我是作者)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM