没有源代码可用于类型< type>你忘了继承一个必需的模块吗? [英] No source code is available for type <type> did you forget to inherit a required module?

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

问题描述


$ b

  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/> 
<继承名称=com.mz.client.application.admin/>
< inherits name =com.mz.client.application.core/>

并且java模块位于 pom.xml中 web客户端模块:

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

但是,我得到:

<$ p编译模块com.mz.client.ClientEntryPoint
[INFO]类型'com.mz.client.application.ApplicationBootstrapper'的跟踪编译失败路径
[INFO] INFO] [错误]'file:/ E:/java/mz/mz-server/mz-web-client/src/main/java/com/mz/client/application/ApplicationBootstrapper.java'中的错误
[INFO] [错误]第144行:没有源代码可用于com.mz.client.application.core.network.ParallelRequest.ParallelCallback类型;你忘了继承一个必需的模块吗?
[INFO] [ERROR]第77行:没有源代码可用于com.mz.client.application.core.dao.app.ApplicationData类型;你忘了继承一个必需的模块吗?
[INFO] [ERROR]第103行:无类型的源代码可用于com.mz.client.application.core.network.XsrfRequest< S,R>类型。你忘了继承一个必需的模块吗?
[INFO] [错误]第144行:没有源代码可用于com.mz.client.application.core.dao.shop.ShopAdmin类型;你忘了继承一个必需的模块吗?
[INFO] [ERROR]第49行:没有源代码可用于com.mz.client.application.core.LogMessageFormatter类型;你忘了继承一个必需的模块吗?
[INFO]跟踪'com.mz.client.application.ApplicationModule'类型的编译失败路径
[INFO] [错误]'file:/ E:/ java / mz / mz-server中的错误/mz-web-client/src/main/java/com/mz/client/application/ApplicationModule.java'
[INFO] [错误]第18行:没有源代码可用于com.mz.client类型.application.landing.LandingModule;你忘了继承一个必需的模块吗?
[INFO] [错误]第20行:没有源代码可用于com.mz.client.application.admin.AdminToolModule类型;你忘了继承一个必需的模块吗?
[INFO]跟踪'com.mz.client.application.login.LoginPresenter'类型的编译失败路径
[INFO] [错误]'file:/ E:/ java / mz / mz中的错误-server / mz-web-client / src / main / java / com / mz / client / application / login / LoginPresenter.java'
[INFO] [ERROR]第124行:没有源代码可用于com .mz.client.application.core.event.AdminLoginEvent;你忘了继承一个必需的模块吗?
[INFO] [ERROR]第75行:没有源代码可用于com.mz.client.application.core.network.Request< R>类型;你忘了继承一个必需的模块吗?
[INFO] [错误]第112行:没有源代码可用于com.mz.client.application.core.dao.shop.ShopAdmin类型;你忘了继承一个必需的模块吗?
[INFO] [ERROR]第112行:没有源代码可用于com.mz.client.application.core.network.ParallelRequest.ParallelCallback类型;你忘了继承一个必需的模块吗?
[INFO] [错误]由于某些输入文件中的错误而中止编译

I don看看我在这里丢失了什么。

解决方案

您需要将源文件作为资源包含到模块中,或者添加除了jar文件之外,还有源文件的依赖关系。

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



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


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

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-admin <----
               /                          \ 
web-client <---                            <---- web-client-core
               \                          /
                <-- web-client-landing <--

In my module.gwt.xml I am having:

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

    <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.

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

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)

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

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