0

I'd like to be able to run my PlayN project as a Web Application in DevMode, so that I can use a quick browser refresh to see code changes without having to recompile. From what I'm reading on the wiki and on this question it sounds like that should be possible.

I set up my project using: mvn archetype:generate -DarchetypeGroupId=com.googlecode.playn -DarchetypeArtifactId=playn-archetype -DarchetypeVersion=1.7 and importing the pom.xml into eclipse.

Here's what I can do:

  • Run from eclipse as a Java Application
  • Start the server using Maven command line: mvn -Phtml integration-test

While I can do most of my programming in Java and occasionally do the long build to test HTML, I'd love to be able to modify the code while testing HTML without recompiling.

By default, the option to run as a Web Application doesn't show up. I've tried going into the project's properties and checking the "Use Google App Engine" and "Use Google Web Toolkit" options, which creates the "Run As Web Application" option, but when I do so I get "Could not find any host pages in project XXX".

I then attempt to set a WAR directory under Properties->Google-Web Application. However, the closest thing to a WAR in the project is "src/main/webapp". I've tried using that, and I get the error: "The archive: /myproject-assets/src/main/java which is referenced by the classpath, does not exist."

I have the feeling I'm going about this all wrong. Can anyone point me in the right direction? Is what I'm doing even supposed to be possible? Thanks!

Community
  • 1
  • 1
thomas88wp
  • 2,381
  • 19
  • 31

1 Answers1

0

It is possible, but just know that in dev mode, playn runs very slow.

I don't know how to do this with eclipse, but with intelli IDEA, you do the following:

  1. you need to create a module with a war artifact (to run as a server)
  2. add the correct gwt libraries so that you can run gwt dev mode server with the aforementioned war module.
  3. choose a GAE server (or, any gwt compatible server actually, this will be the server that runs the aformentioned war module).
  4. run it! see this screenshot http://screencast.com/t/qK4JKvF33V
  5. when you change code, the gwt devmode server should detect it, and automatically recompile (not sure if this needs to be in debug mode - i don't think it does).

you can try doing it via the command line, not sure if works, but this is what intellij runs (i've taken out the intellij specific bits out):

java -cp CLASSPATH_WITH_GAE_DEV_TOOLS_AND_GWT_DEV_TOOLS com.google.gwt.dev.DevMode 
     -war /path/to/war 
     -startupUrl Roborally.html com.yourgame.YourGwtEntryModule 
     -server com.google.appengine.tools.development.gwt.AppEngineLauncher
Chii
  • 14,540
  • 3
  • 37
  • 44