GWT 2.8 and Guava 20

643 views
Skip to first unread message

Johan Falk

unread,
Jun 21, 2016, 9:59:51 AM6/21/16
to GWT Users
While not only a GWT question, I thought this was the best place to ask. I've got an GWT 2.7 application which is being upgraded to 2.8. I'm using one of the latest snapshot (2.8.0-269) together with Guava (20.0.220-SNAPSHOT).

The problem is I get the same type of error that is mentioned in this issue: https://github.com/gwtproject/gwt/issues/9323, but just adding both error_prone_annotations and j2objc-annotations jars to the classpath when running the CodeServer doesn't seem to work for me.

I did get it working by manually adding a GWT module file (Annotations.gwt.xml) to both jars, which just sets the source path:
<module>
    <inherits name="com.google.gwt.core.Core" />

    <source path=""/>
    <source path="concurrent"/>
    <super-source path="super" />
</module>

And then add then reference this in my main Module file:
<inherits name="com.google.errorprone.annotations.Annotations" />
<inherits name="com.google.j2objc.annotations.Annotations" />

But I would like to avoid manually modifying those jars (as that makes each upgrade more of a pain, and I need to upload the modified jars to our maven repository instead of just mirroring the existing ones). Anyone have any idea what I'm missing?

Thomas Broyer

unread,
Jun 21, 2016, 10:06:49 AM6/21/16
to GWT Users
No idea why GWT complains, but just a note in passing that you don't have to "patch" the JARs: GWT works from the classpath, so it only matters that the Annotations.gwt.xml files exist in the com.google.errorprone.annotations and com.google.j2objc.annotations packages, whichever the exact location "on disk"; so they can just live in your app sources, or for example in small JARs deployed to your Maven repo, that would depend on the error_prone_annotations and j2objc-annotations source JARs. 
Message has been deleted

Johan Falk

unread,
Jun 22, 2016, 5:43:21 AM6/22/16
to GWT Users
Ye I think it is very weird that GWT complains. But the workaround of just placing the com.google.errorprone.annotations GWT module file in our own jar seems to work fine, thanks for the quick reply!
Reply all
Reply to author
Forward
0 new messages