Try the instructions on this page, in the "Building with Eclipse and
Maven (m2e)" section:
I also don't have options for flash and html projects.
Compiling the HTML5 version of the game in using the standard Eclipse
mechanisms is cumbersome, and not easy to test.
I recommend using the build.xml Ant script, which you can also run
from within Eclipse:
Expand the playn-hello project in the Package Explorer, right click on
the build.xml file and select "Run as -> Ant build..." (the one with
the ... not the one without). Then uncheck "compile" and check
"run-html" and click Run.
This will compile the JavaScript version of the game and run an
embedded Jetty process that allows you to test it. Look in the console
tab and you should see it report this output after the compilation is
done:
[echo] =================================================================
[echo] Browse to http://localhost:8080/hello/HelloGame.html
[echo] =================================================================
One you see that, you can browse to the reported URL to play the HTML5
version of the game in your desired browser.
When you're done, click the red square in the UI to the right of the
Console tab to terminate the running Jetty process.
-prepare:
[artifact:dependencies] Downloading: com/googlecode/playn/playn-java/1.0-SNAPSHOT/playn-java-1.0-SNAPSHOT.pom from repository forplay-legacy at http://forplay.googlecode.com/svn/mavenrepo
[artifact:dependencies] Unable to locate resource in repository
[artifact:dependencies] [INFO] Unable to find resource 'com.googlecode.playn:playn-java:pom:1.0-SNAPSHOT' in repository forplay-legacy (http://forplay.googlecode.com/svn/mavenrepo)
[artifact:dependencies] Downloading: com/googlecode/playn/playn-java/1.0-SNAPSHOT/playn-java-1.0-SNAPSHOT.jar from repository forplay-legacy at http://forplay.googlecode.com/svn/mavenrepo
[artifact:dependencies] Unable to locate resource in repository
[artifact:dependencies] [INFO] Unable to find resource 'com.googlecode.playn:playn-java:jar:1.0-SNAPSHOT' in repository forplay-legacy (http://forplay.googlecode.com/svn/mavenrepo)
[artifact:dependencies] An error has occurred while processing the Maven artifact tasks.
[artifact:dependencies] Diagnosis:
[artifact:dependencies]
[artifact:dependencies] Unable to resolve artifact: Missing:
Ah, I forgot you need to "mvn install" the main library jars into your
local Maven repository first.
Right click on playn-project and select Run as -> Maven install. This
will take a long time (5 minutes on my pretty fast computer), but when
you're done you should be able to run the hello sample in HTML5 mode
as I described.
It is possible to build the JavaScript version of the game in the
"standard Eclipse" way, if you first do some manual steps to configure
the GWT Eclipse plugin (unfortunately it does not auto-detect that
imported projects are GWT projects).
However, I am not aware of any way to build the JavaScript version of
the game *and* temporarily serve it up via HTTP so that it can be
tested, from within Eclipse. You cannot just point the browser at the
generated JavaScript game on the file system, it has to be served up
via HTTP.
AFAIK, using the Ant build target is the only way that you can easily
test your game in HTML5.
If you use the "Run as -> Web application" command in Eclipse, that
runs the game in GWT devmode, which is unusably slow, due to the way
GWT devmode works. There's no way we will ever be able to make running
a game in GWT devmode fast, which is why we recommend that you do most
of your testing using the Java backend, and only periodically test the
HTML5 backend by compiling the game to JavaScript (which takes a long
time, and is not suitable for frequent testing and debugging).
-Ray