问题
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..
回答1:
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)
来源:https://stackoverflow.com/questions/37365459/no-source-code-is-available-for-type-type-did-you-forget-to-inherit-a-required