使用与 GWT 捆绑的 Guava
GWT 2.2 及更高版本包括 Guava。包含 Guava 的包是 com.google.gwt.thirdparty.guava。但是,似乎没有模块 XML 文件允许在客户端(可翻译)代码中使用此包。根据这一观察,这个 Guava 副本似乎仅供 GWT 内部使用。
对于使用 Guava 的 GWT 项目,建议的方法是单独下载 Guava 吗?如果没有,在客户端代码中包含 com.google.gwt.thirdparty.guava
的过程是什么?
GWT 2.2 and later includes Guava. The package containing Guava is com.google.gwt.thirdparty.guava
. However, there doesn't seem to be a module XML file that would allow this package to be used in client (translatable) code. Based on this observation, it would seem that this copy of Guava is intended for GWT-internal use only.
For GWT projects using Guava, is the suggested approach to download Guava separately? If not, what is the process for including com.google.gwt.thirdparty.guava
in client code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,如果您想自己使用 Guava,则需要 guava 和 guava-gwt jar,并在 gwt.xml 文件中引用所需的模块。过去,您还需要 jsr305,尽管我的理解是这个问题正在被修复,所以您在 r09 中可能不需要它
Yes, if you want to use Guava yourself, you'll need the guava and guava-gwt jars, and reference the modules you want in your gwt.xml file. In the past, you've also needed jsr305, although my understanding is that this was being fixed, so you may not need that in r09
你的假设是正确的;仅供内部使用;单独下载。如果使用 Maven,请在 pom.xml 中包含以下内容:
Your assumption is correct; it's for internal use only; download it separately. If using Maven, include the following in your pom.xml: