Some notes on using the maven-googletoolkit2-plugin. Download the code for the plugin from the project's subversion repository. I used the command svn checkout http://gw-maven.googlecode.com/svn/trunk/ gwt-maven. You only need to build the maven-googlewebtoolkit2-support module. However, it won't build as is because it has a dependency that it doesn't need on maven-googlewebtoolkit-support and when you try and build the whole project there is a error. com.thoughtworks.qdox.parser.ParseException: syntax error @[47,64] in file:.../com/totsp/mavenplugin/gwt/support/beans/Bean.java Easy enouth to fix though, just delete the dependency from the pom and then mvn install will put the plugin in your local repository.
Next you have to configure the plugin in your pom. The plugin depends on the gwt-user and gwt-dev jars so you have to install these to your local repository using mvn install:install-file. For example
mvn install:install-file -Dfile=gwt-user.jar -DartifactId=gwt-user -DgeneratePom=true -DgroupId=com.google.gwt -Dpackaging=jar -Dversion=1.3
The plugin configuration itself should look something like.
<plugin>
<groupId>com.totsp.gwt.maven</groupId>
<artifactId>maven-googlewebtoolkit2-plugin</artifactId>
<configuration>
<googleWebToolkitOutputDirectory>${basedir}/src/main/webapp</googleWebToolkitOutputDirectory>
<googleWebToolkitCompileTarget>com.google.gwt.sample.hello.Hello</googleWebToolkitCompileTarget>
<sourceDirectories>
<param>${basedir}/src/main/java</param>
</sourceDirectories>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev-mac</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>1.3</version>
</dependency>
</dependencies>
</plugin>
The googleWebToolkitOutputDirectory is where the generated code is placed. This is changed from the default value to fit with a standard maven directory layout. googleWebToolkitCompileTarget is the module to compile and sourceDirectories specifies where to look for the source code.
Finally, to execute the gwt compiler you use mvn googlewebtoolkit2:compile