简体   繁体   English

没有源代码可用于类型 <type> 您忘了继承必需的模块吗?

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

I am trying to split my project into 4 Java modules: 我试图将我的项目分成4个Java模块:

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

The module web-client is the one that puts all pieces together, so the dependency tree would look something like this: 模块web-client是将所有部分组合在一起的模块,因此依赖关系树如下所示:

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

In my module.gwt.xml I am having: 在我的module.gwt.xml我有:

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

and the java modules are in the pom.xml of the web-client module: 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>

However, I am getting: 但是,我得到:

[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.. 我看不到我在这里想念的..

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. 鉴于这些都是客户端模块,我宁愿将源代码包含在JAR中。

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) 您可以简单地将src/main/java声明为其他<resource> ,也可以使用gwt-maven-plugin(也许看看https://tbroyer.github.io/gwt-maven-plugin/ gwt-lib包装;免责声明:我是作者)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 没有源代码可用于org.quartz.CronExpression类型。 您忘了继承必需的模块吗? - No source code is available for type org.quartz.CronExpression; did you forget to inherit a required module? 没有源代码可用于类型 <xyz> ; 您忘了继承必需的模块吗? - No source code is available for type <xyz>; did you forget to inherit a required module? 尝试将我的GWT项目拆分为多个模块-“您是否忘记了继承必需的模块?” - Trying to split my GWT project into multiple modules - “did you forget to inherit a required module?” GWT:导入后“没有源代码可用于输入” - GWT: “No source code is available for type” after import GWT - 编译错误:没有可用于类型的源代码 - GWT - Compilation error: No source code is available for type GWT没有可用于类型[userClassName]的源代码 - GWT No source code is available for type [userClassName] GWT Maven 项目无法编译 - 没有可用于类型的源代码 - GWT Maven Project fails to compile - No source code is available for type GWT“ IncrementCompileWarnings”标志设置为true时“类型无源代码” - GWT “No source code is available for type” when incrementalCompileWarnings flag set to true Maven + GWTTestCase + Test =&gt;没有可用于nnn类型的源代码(依赖) - Maven + GWTTestCase + Test => No source code is available for type nnn (of dependency) gwt-maven-plugin无法编译,因为“没有适用于org.hibernate.validator.constraints.impl.SizeValidatorForString类型的源代码;” - gwt-maven-plugin can't compile because of “No source code is available for type org.hibernate.validator.constraints.impl.SizeValidatorForString;”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM