I wanted to be able to build my war locally and then post it to Geronimo and Tomcat manually and was having trouble doing so. I was able to do it by altering the default build.xml thusly:
<?xml version="1.0" encoding="utf-8" ?>
<project name="ImageViewer" default="all" basedir="/home/jim/Projects/Eclipse/Hawkeye">
<description>
This is build file for GWT module 'com.hsbc.na.crs.cim.hawkeye.Hawkeye' deployment.
GWT Designer generates it each time when you initiate deployment.
You can use this file later for manual deployment, but keep in mind, that
classpath is hardcoded in it, so after changes in classpath you should
regenerate build file.
</description>
<property name="gwt.home" value="/home/jim/Programs/gwt-linux-1.5.3" />
<property name="gwt.module.id" value="com.hsbc.na.crs.cim.hawkeye.Hawkeye" />
<property name="war.name" value="Hawkeye.war" />
<target name="jars" description="Package up the module project and required projects as jars">
<mkdir dir="@dot/${gwt.module.id}/WEB-INF/lib" />
<!--=== Hawkeye ===-->
<jar destfile="@dot/${gwt.module.id}/WEB-INF/lib/Hawkeye.jar">
<fileset dir="/home/jim/Projects/Eclipse/Hawkeye/src">
<include name="**"/>
</fileset>
<fileset dir="/home/jim/Projects/Eclipse/Hawkeye/bin">
<include name="**/*.class"/>
</fileset>
</jar>
</target>
<target name="gwt-compile" description="Compile to JavaScript">
<delete dir="@dot" />
<java classname="com.google.gwt.dev.GWTCompiler" fork="yes" failonerror="true" maxmemory="64m">
<classpath>
<pathelement location="/home/jim/Projects/Eclipse/Hawkeye/src" />
<pathelement location="/home/jim/Projects/Eclipse/Hawkeye/bin" />
<pathelement location="/home/jim/Programs/gwt-linux-1.5.3/gwt-user.jar" />
<pathelement location="/home/jim/Programs/gwt-linux-1.5.3/gwt-dev-linux.jar" />
</classpath>
<arg value="-style"/>
<arg value="OBFUSCATED"/>
<arg value="-out" />
<arg file="@dot" />
<arg value="${gwt.module.id}" />
</java>
</target>
<target name="web-xml">
<mkdir dir="@dot/${gwt.module.id}/WEB-INF" />
<echo file="@dot/${gwt.module.id}/WEB-INF/web.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns= "http://java.sun.com/xml/ns/javaee">
<servlet>
<servlet-name>com.hsbc.na.crs.cim.hawkeye.server.HawkeyeServiceImpl</servlet-name>
<servlet-class>com.hsbc.na.crs.cim.hawkeye.server.HawkeyeServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>com.hsbc.na.crs.cim.hawkeye.server.HawkeyeServiceImpl</servlet-name>
<url-pattern>/HawkeyeService</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>
Hawkeye.html
</welcome-file>
</welcome-file-list>
</web-app>
]]></echo>
<echo file="@dot/${gwt.module.id}/WEB-INF/geronimo-web.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1">
<environment>
<moduleId>
<artifactId>Hawkeye</artifactId>
</moduleId>
</environment>
<context-root>/Hawkeye</context-root>
</web-app>
]]></echo>
</target>
<target name="war" depends="gwt-compile, jars, web-xml">
<!-- update compilation results -->
<!--<delete dir="@dot/${gwt.module.id}/.gwt-compiler" />
<move todir="@dot/${gwt.module.id}">
<fileset dir="@dot/${gwt.module.id}/std">
<include name="**"/>
</fileset>
</move>-->
<!-- do create WAR -->
<delete file="${war.name}" />
<copy file="${gwt.home}/gwt-servlet.jar" todir="@dot/${gwt.module.id}/WEB-INF/lib" />
<jar destfile="${war.name}" basedir="@dot/${gwt.module.id}" duplicate="preserve" />
<!-- clean up
<delete dir="@dot" />-->
</target>
<target name="deploy" depends="war">
<move file="${war.name}" todir="/home/jim/Projects/Eclipse/Hawkeye/war" />
</target>
<target name="all" depends="deploy" />
</project>
Would it be possible to add those bits to the default build.xml that you create? I would also ask that the "deploy" target be split so that there is a clean break between posting it into my project folder and posting it to the server. And, while I'm at it, a bit more control over the build artifacts. Perhaps give folks the option to keep the intermediate artifacts around (the web.xml file in particular), to use an existing file in the build, and or add other files to war (like geronimo-web.xml or anything else. I know that in the doc you make mention that if you need to have more control to create/use a Web Project, but then you also make mention that Web Projects and GWT Projects shouldn't be mixed, so that kind of kills that.
Thanks!