Dec 6, 2011

Developing GWT Faster

Xydra has a nice GWT module. Compiling it was too slow. How to speed it up?
This is the short version of what happened:

After exploring the easy ways we went from 5 min compile to 1,5 min. Not bad, but still too slow.

We tried to get (hosted) development mode to run with GWT and Maven. A bit tricky. Maybe -noserver (doc is for GWT 1.6) helps.
That worked up to a certain point. We reached a strange exception from the development mode GWT pseudo-compiler (then one that communicates with the browser-plugin). The error was something about gwt-log. So maybe gwt-log is not compatible with our GWT version? So we wanted to upgrade GWT. But we did not use the GWT version consistenly. So we moved it to a new parent pom. Can you have conditional sections in the parent pom that you turn on in the children, when needed? After consulting Stackoverflow:
  • Q: Can Maven compose a pom out of multiple parts? A: Only, if you're clever. It will be supported well in Maven 3.1. 
  • Q: Will 3.1 come out soon? Rather not. 
  • Q: Is it worth upgrading to Maven 3.0? Yes, because its faster. And compatible with 2.0 poms. And the error reporting is much clearer.
Ok. So we upgraded to Maven 3.0.3. And we use profiles in a parent pom. This means, the files "uses-gwt.marker" etc are now really important. Yes, it is much faster!

So now that we were in the pom-business, we upgraded all kinds of libraries. Minor upgrades:
  • Upgraded from SLF4J 1.5.0 to 1.6.4, which has some bug fixes. Details at http://slf4j.org/news.html
  • Upgraded maven-antrun-plugin from 1.2 to 1.7
  • Upgraded commons-io from 1.4 to 2.1
  • Upgraded to gwt-log 3.1.6, just in time they deploy to Maven Central now. Of course, like every good (*cough*) maven plugin, they changed the groupId.
  • Upgraded from JUnit 4.8.2 to 4.10
  • Upgraded Log4j from 1.2.14 to 1.2.16 - seems to be a pretty stable lib.
Following the main goal, we also upgraded the GWT and GAE monsters:
  • Upgraded to Google AppEngine 1.6.0 with the compatible maven-gae-plugin 0.9.2. Cool, its in Maven Central now. Yes, one repo less to use!
  • Changed from GWT 2.x to GWT 2.4. Also using gwt-maven-plugin 2.4.0.
... some hours later...after updating many many poms... hosted mode runs!
The app still runs. And much complexity from the poms is gone and has been moved to the parent pom.


No comments:

Post a Comment