如何在maven中将gwt应用程序打包为war文件?
我们正在使用 gwt-maven-plugin:2.4.0
mvncompile
工作正常。
但是,mvn package
不起作用并最终出现以下错误。 CLASSPATH 看起来确实正确,并且包含 gwt/2.4.0
.gwt.xml 的用户和服务器部分的所有类,看起来也正确。
不确定这是否是我们应该用来创建包含生成的 war 文件的包的正确生命周期阶段。 ? 我们首先如何生成涉及 gwt 的包?
[INFO] --- gwt-maven-plugin:2.4.0:compile (default) @ xyz-alp-ui-web ---
[INFO] auto discovered modules [com.xyz.solutions.alp.alpui]
[INFO] Compiling module com.xyz.solutions.alp.alpui
[INFO]
[ERROR] Errors in 'file:/Z:/xyz-alp-ui-web/src/main/java/com/xyz/solutions/alp/client/ApplicationController.java'
[INFO]
[ERROR] Internal compiler error
[INFO] java.lang.NoClassDefFoundError: com/google/gwt/autobean/shared/AutoBeanFactory
我有 com\google\gwt\gwt-user\2.4.0\gwt-user-2.4.0.jar
、com\google\gwt\gwt-dev\2.4.0\类路径中的 gwt-dev-2.4.0.jar
。
我们使用的是maven 3.0
We are using gwt-maven-plugin:2.4.0
mvn compile
does work fine.
However mvn package
does not work and ends up with a following error. The CLASSPATH does look right and contains all the classes of user and server part of gwt/2.4.0
.gwt.xml does look right too.
Not sure if this is the right life cycle phase we should be using to create the package that contains generated war file. ?
How do we generate the package in the first place, where gwt is involved ?
[INFO] --- gwt-maven-plugin:2.4.0:compile (default) @ xyz-alp-ui-web ---
[INFO] auto discovered modules [com.xyz.solutions.alp.alpui]
[INFO] Compiling module com.xyz.solutions.alp.alpui
[INFO]
[ERROR] Errors in 'file:/Z:/xyz-alp-ui-web/src/main/java/com/xyz/solutions/alp/client/ApplicationController.java'
[INFO]
[ERROR] Internal compiler error
[INFO] java.lang.NoClassDefFoundError: com/google/gwt/autobean/shared/AutoBeanFactory
I have com\google\gwt\gwt-user\2.4.0\gwt-user-2.4.0.jar
, com\google\gwt\gwt-dev\2.4.0\gwt-dev-2.4.0.jar
in classpath.
We are using maven 3.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
gwt-servlet.jar
放入依赖项列表中。您可以调整范围设置,在运行时和编译之间更改它以满足您的需求。哦,还有一件事:从您的 pom.xml 中删除
gwt-dev
,如 Kabram 上面所述。Place
gwt-servlet.jar
in your dependencies list.you can fiddle with scope setting changing it between runtime and complile to suit your needs. Oh and one more thing: remove
gwt-dev
from your pom.xml, as kabram stated above.