GwtModule.gwt.xml
文件的内容为(摘要):<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='mygwtmodule'>
<!-- Inherit the core Web Toolkit stuff. -->
<inherits name='com.google.gwt.user.User' />
<!-- Other module inherits go here -->
<!-- Specify the paths for translatable code -->
<source path='client' />
<source path='shared' />
</module>
gwt.xml
文件在src/main/java/my/module
中,实现com.google.gwt.core.client.EntryPoint
的入口点在src/main/java/my/module/client/MyModule.java
中。
然后,我在servlet项目中使用此代码,将另一个工件作为我的<dependencies>
之一导入。 Servlet项目有一个src/main/resources/my/webapp/GwtWebapp.gwt.xml
文件,该文件仅包含:
<?xml version="1.0" encoding="UTF-8"?>
<module rename-to='myservlet'>
<inherits name='my.module.GwtModule' />
<!-- Specify the app entry point class. -->
<entry-point class='my.module.client.MyModule' />
</module>
并且此配置使用GWT的2.7.0和2.8.0版本以及相应的maven插件已经运行了好几年。
但是现在我已经升级到Java 11,它需要Maven GWT 2.8.2插件,突然间它失败了。在两个项目中仅将GWT版本更改为2.8.2
,在GWT模块上运行mvn install
,然后在servlet项目中运行mvn gwt:compile
,这给我:
.
.
[INFO] Compiling module my.webapp.GwtWebapp
[INFO] Ignored 1 unit with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO] Finding entry point classes
[INFO] [ERROR] Hint: Check that the type name 'my.module.client.MyModule' is really what you meant
[INFO] [ERROR] Hint: Check that your classpath includes all required source roots
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
.
.
对确定此问题根源的任何帮助,将不胜感激。
我有一个Maven工件,其中包含GWT模块的代码。 GwtModule.gwt.xml文件的内容(摘要)是:
]
.jar
文件中。我必须明确添加:<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
<include>**/*.gwt.xml</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>