我正在尝试将项目拆分为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模块位于pom.xml
模块的web-client
中:
<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
我不知道我在这里失踪了什么..
答案 0 :(得分:2)
您需要将源文件作为资源包含到模块中,或者除了jar文件之外还要添加依赖项到源工件。
鉴于这些都是客户端模块,我宁愿将资源包含在JAR中。
您可以简单地将src/main/java
声明为<resource>
,或者您可以使用gwt-maven-plugin(也许可以查看https://tbroyer.github.io/gwt-maven-plugin/ gwt-lib
包装;免责声明:我是作者)