GWT + maven + jetty + stripes
bringing it all together
I'm currently working on a new WEB 2.0 style application. As I don't want to waste my time writing JavaScript I decided to make use of GWT in certain areas of the application. As I can't live anymore without maven ;-) I wanted to build my GWT code with it as well. Fortunately there is an excellent maven plugin for GWT: gwt-maven. The only thing I was missing was a configuration that allows me to either use mvn gwt:gwt (for launching GWT in hosted mode, using a mock implementation of my RPC RemoteServlet) or mvn jetty:run (to launch my application in production mode).
After some time I came to the following multi module layout that fulfills my requirements above:
- project parent pom: contains common configuration, repository locations etc.
- rpc module: contains the RPC interfaces and a dummy implementation for hosted mode
- gwt module: war project, contains the actual GWT client application
- war module: contains the java webapplication, including the implementation of the RPC server interface, using the stripes framework
With this configuration I'm able to test and debug the GWT application by running mvn gwt:gwt in the gwt module. Inside the war module I'm able to do integration testings of the whole application and not only the GWT parts:
See the attached .zip file for an example project, it is quite self-explanatory and should run out of the box if maven 2.0.9 or higher is installed.