Using Guava in a Maven GWT Project

I have a project that would like to use the Google Guava libraries (both on the server side and on the client side), however I am having problems with the setup.

I managed to add GWT and Guava as dependencies, and my GWT projects compile correctly. My server code using Guava also works correctly.

But if I try to add it to my GWT project using the following:

<inherits name="com.google.common.collect.Collect" /> 

And use the application in development mode via mvn gwt:run , it opens the Google development mode interface and gives taste errors:

 Unable to find 'com/google/common/collect/Collect.gwt.xml' on your classpath... 

Presumably, because the maven dependency is only compiled class files, not source / .gwt.xml files, which must be compiled before Javascript. I found that if I go to the guava site and upload the files, the guava-r08-gwt.jar file will appear, which, I think, is moving towards the solution.

Ideally, there is some dependency that I could add to Maven that just allows me to use the inherits command, but any other workarounds would be welcome.


As mentioned in one of the answers, this works.

In the meantime, I created a temporary public maven-repo for this purpose. I do not make any guarantees that he did not sleep, but here is the material of the repo / addiction:

 <repository> <id>deepthought</id> <name>Deepthought Public Repository</name> <url>http://deepthought.co/maven-repo</url> </repository> <dependency> <groupId>com.google.guava</groupId> <artifactId>guava-gwt</artifactId> <version>r08</version> </dependency> 

Feel free to use it for now.

+6
maven guava gwt
source share
1 answer
+7
source share

All Articles