We use seam+richfaces+gwt and it works very well. Although we build everything with maven, I suppose you can use ant as well. The general idea is to start the whole web application in GWT Development Mode. You don't have to compile everything (which takes a long time in case of GWT compiler). Development mode will compile requested resources on demand. By running GWT application this way, you can also debug client side code.
It is also possible to call GWT methods in response to seam actions.
Update:
I can elaborate on our solution a bit:
Maven
Your project should be configured with packaging: war
. There are some official instructions on setting seam with maven (also richfaces):
http://docs.jboss.org/seam/2.2.1.CR2/reference/en-US/html/dependencies.html#d0e34791
http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/SettingsForDifferentEnvironments.html
For GWT add following sections to your pom.xml
:
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>2.1.0</version>
<scope>provided</scope> <!-- prevents from including this in war -->
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>2.1.0</version>
<scope>provided</scope> <!-- prevents from including this in war -->
</dependency>
<dependency>
<groupId>pl.ncdc.gwt</groupId>
<artifactId>gwt-servlet-war</artifactId>
<version>2.1.0</version>
<type>war</type> <!-- adds gwt-servlet.jar to your war, but not to your classpath -->
</dependency>
<!-- build section -->
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/client/**/*.java</include>
<include>**/client/**/*.properties</include>
<include>**/shared/**/*.java</include>
<include>**/shared/**/*.properties</include>
<include>**/*.gwt.xml</include>
</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/java</directory>
<includes>
<include>**/client/**/*.java</include>
<include>**/client/**/*.properties</include>
<include>**/shared/**/*.java</include>
<include>**/shared/**/*.properties</include>
<include>**/*.gwt.xml</include>
</includes>
</testResource>
</testResources>
<plugins>
<plugin> <!-- dirty hack for GWT issue #3439 - it is not really fixed -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>remove-javax</id>
<phase>compile</phase>
<configuration>
<tasks>
<delete dir="${project.build.directory}/classes/javax" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.3.2.google</version>
<configuration>
<extraJvmArgs>-Xmx512M</extraJvmArgs>
<gwtVersion>${gwt.version}</gwtVersion>
<modules>
<module>com.company.gwt.project.module.Module</module>
</modules>
<soyc>false</soyc>
<draftCompile>${gwt.draft.compile}</draftCompile> <!-- you can control this with profiles -->
<localWorkers>2</localWorkers><!-- in theory should speed things up on our quad CPU hudson -->
<style>${gwt.style}</style> <!-- you can control this with profiles -->
</configuration>
<executions>
<execution>
<id>compile</id>
<phase>prepare-package</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>gwt-test</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<includes>**/*GwtTestSuite.java</includes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.1</version>
<configuration>
<archiveClasses>true</archiveClasses>
<warSourceDirectory>src/main/webapp-empty</warSourceDirectory> <!-- just empty dir for workaround -->
<webResources>
<resource>
<directory>src/main/webapp</directory>
<excludes>
<exclude>app.*</exclude> <!-- name of you gwt module(s) - rename-to in gwt.xml -->
<exclude>WEB-INF/web.xml</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/webapp</directory>
<includes>
<include>WEB-INF/web.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
This configuration should produce war with both - seam and gwt compiled. If you want to use such project in development mode put also this in pom.xml
:
<dependency>
<groupId>com.xemantic.tadedon</groupId>
<artifactId>tadedon-gwt-dev</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
And add -server com.xemantic.tadedon.gwt.dev.JettyLauncher
to your google web application launcher. This is maven friendly jetty launcher which might be necessary in some situations.
I hope it will help you. Are you interested in communication between gwt and richfacaes application?