google guava

126 views
Skip to first unread message

andres

unread,
Oct 11, 2011, 10:58:00 AM10/11/11
to PlayN
Hi

Is it possible to use google guava? I see that it's included in PlayN
so I assume yes, but I get compile errors when I try to export to
HTML5 backend.

I tried adding

<dependency>
<groupId>com.google.guava-gwt</groupId>
<artifactId>guava</artifactId>
<version>10.0</version>
</dependency>

to the html/pom.xml file but it doesn't resolve it

Thanks

Christopher Östlund

unread,
Oct 11, 2011, 11:06:46 AM10/11/11
to pl...@googlegroups.com
Hi,

I use Guava in my project. I manually add it. Don't forget to add it to your .gwt.xml files too, so they are included for compilation.

Andres Martinez Quijano

unread,
Oct 11, 2011, 11:19:37 AM10/11/11
to pl...@googlegroups.com
Can you show me exactly how you added it and to which files? I know almost nothing about Maven

Thanks!

2011/10/11 Christopher Östlund <christophe...@gmail.com>

Michael Bayne

unread,
Oct 11, 2011, 8:10:58 PM10/11/11
to pl...@googlegroups.com
On Tue, Oct 11, 2011 at 8:19 AM, Andres Martinez Quijano
<tuls...@gmail.com> wrote:
> Can you show me exactly how you added it and to which files? I know almost
> nothing about Maven

This has nothing to do with Maven, it's a GWT requirement.

You should have a FooGame.gwt.xml file somewhere in your project. Add
this to it:

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

-- m...@samskivert.com

Andres Martinez Quijano

unread,
Oct 11, 2011, 8:41:31 PM10/11/11
to pl...@googlegroups.com
I did that and when I invoke mvn package it complaints with:

[ERROR] Failed to execute goal org.codehaus.mojo:gwt-maven-plugin:2.3.0-2-playn:compile (default) on project h4ck1t-html: GWT Module com.google.common.collect.Collect not found in project sources or resources. -> [Help 1]

That's why I thought it was a Maven error. Maybe I need to do a "mvn install" on guava?

Levi Van Zele

unread,
Oct 12, 2011, 3:19:28 AM10/12/11
to pl...@googlegroups.com
You need to use the GWT version of Guava on your HTML5 side, but the non-GWT version on the core. Maybe it was a typo (.guava instead of .guava-gwt), but it should be like this:

<dependency>
   
<groupId>com.google.guava</groupId>
   
<artifactId>guava-gwt</artifactId>
   
<version>10.0.1</version>
</dependency>

andres

unread,
Oct 12, 2011, 2:36:05 PM10/12/11
to PlayN
That did the trick, thank you!
Reply all
Reply to author
Forward
0 new messages