Skip to content
tbroyer edited this page Apr 5, 2013 · 1 revision

There are basically two kinds of GWT apps:

  • those with a server side component (a Maven module with <packaging>war</packaging> downstream, which will include the resources from the gwt-app module)
  • standalone apps

Client-server apps

For those apps, there could be several GWT apps on the same host page, that one might want to debug all at once, or each one separately. The DevMode can thus be run with several GWT modules to debug, and the warDir should be set to the webappDirectory of the war module. In other words, the DevMode should be run on the war module, including the gwt-app modules in its classpath. The default should probably be to run in -noserver mode, or maybe to automatically run mvn war:exploded -Dgwt.compiler.skip on the war before launching the DevMode with the embedded Jetty, or to use a ServletContainerLauncher that loads classes from the reactor's dependencies and static files from src/main/webapp (the problem with this last approach is that it doesn't work with overlays or specific maven-war-plugin configuration, but AFAICT the tomcat-maven-plugin has the same issue already, and it makes it harder to support AppEngine as it rules out third-party ServletContainerLauncher).

Standalone apps

Those apps are self-contained; the gwt-app won't be used from another module. Static resources (including the HTML host page) will have to be in the public path of the GWT module. The DevMode then needs to run with the embedded server, its warDir set to the project.build.outputDirectory (or actually the same as for the GWT Compiler), and no preparation is needed before running the DevMode (apart from the process-classes phase).

How to tell client-server from standalone apps?

How about a standalone boolean property? It'd default to false as that's what most people do.

When false, the gwt:devmode mojo would skip Maven modules whose packaging is not war. When in the war module, it'd resolve project references from the reactor whose packaging is gwt-app and add their compileClasspathElements in the DevMode classpath. There should be an option to only take some projects into account.

When true, the gwt:devmode mojo would skip Maven modules whose packaging is not gwt-app. When in the gwt-app module, it'd just launch the DevMode with the project's compileClasspathElements as the classpath (in addition to the DevMode's own artifacts).