使用ant部署GWT应用的Bulid.xml文件内容,其中GWT库的路径需要修改。
<?xml version="1.0"?>
<!-- * change to your project name *, when you run just type "ant", it will generate war file automatically -->
<project name="HelloGWT" default="all" basedir=".">
<!-- Where the GWT libs can be found * change to your GWT_Home*-->
<property name="gwt.home" value="D:/download/gwt-windows-1.4.62"/>
<!-- Use Linux or Windows gwt-dev jar * you gwt type windows/linux * -->
<property name="gwt.flavour" value="windows"/>
<path id="compile-classpath">
<!-- * the lib folder include all related-jars of GWT, it should be in same folder with this build.xml *-->
<fileset dir="lib" includes="*.jar"/>
</path>
<path id="gwt-classpath">
<!-- Adjust for Linux/Windows as necessary -->
<fileset dir="${gwt.home}" includes="gwt-dev-${gwt.flavour}.jar"/>
</path>
<target name="all" depends="clean,dist" description="Compile/generate all client-side and server-side content"/>
<target name="clean" description="Delete all build artifacts">
<delete dir="build"/>
<delete dir="www"/>
<delete dir="bin"/>
<delete dir="tomcat"/>
<delete file="${ant.project.name}.war" />
</target>
<target name="compile" description="Compile Java classes required on serverside">
<mkdir dir="build/classes"/>
<javac classpathref="compile-classpath" sourcepath="" srcdir="src" destdir="build/classes">
<!-- * Your GWT structure should following the GWT default one, Otherwise, change here *-->
<include name="**/server/**/*.java"/>
<include name="**/client/**/*.java"/>
</javac>
</target>
<target name="gwt-compile" description="Generate clientside content with GWT">
<mkdir dir="www"/>
<java classpathref="gwt-classpath" classname="com.google.gwt.dev.GWTCompiler" fork="true">
<classpath>
<pathelement path="src"/>
<fileset dir="${gwt.home}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<arg value="-out"/>
<arg value="www"/>
<arg value="-style"/>
<arg value="DETAILED"/>
<!-- * your GWT project package *
<arg value="com.maqujun.too.handsome.Handsome"/>
-->
<arg value="hello.HelloGWT"/>
</java>
</target>
<target name="gwt-shell" description="Launch App in GWT shell" depends="compile">
<java classpathref="gwt-classpath" classname="com.google.gwt.dev.GWTShell" fork="true">
<classpath>
<pathelement path="src"/>
<pathelement path="bin/classes"/>
<fileset dir="lib" includes="*.jar"/>
</classpath>
<arg value="-out"/>
<arg value="www"/>
<!-- * your GWT project package and html path* -->
<arg value="hello.HelloGWT/HelloGWT.html"/>
</java>
</target>
<target name="dist" description="Package the web-application for deployment" depends="compile,gwt-compile">
<war destfile="${ant.project.name}.war" webxml="webapp/WEB-INF/web.xml" >
<lib dir="lib" includes="*.jar"/>
<classes dir="build/classes"/>
<!-- * your GWT project package * -->
<fileset dir="www/hello.HelloGWT" excludes="**/*.gwt.xml"/>
</war>
</target>
</project>
<?xml version="1.0"?>
<!-- * change to your project name *, when you run just type "ant", it will generate war file automatically -->
<project name="HelloGWT" default="all" basedir=".">
<!-- Where the GWT libs can be found * change to your GWT_Home*-->
<property name="gwt.home" value="D:/download/gwt-windows-1.4.62"/>
<!-- Use Linux or Windows gwt-dev jar * you gwt type windows/linux * -->
<property name="gwt.flavour" value="windows"/>
<path id="compile-classpath">
<!-- * the lib folder include all related-jars of GWT, it should be in same folder with this build.xml *-->
<fileset dir="lib" includes="*.jar"/>
</path>
<path id="gwt-classpath">
<!-- Adjust for Linux/Windows as necessary -->
<fileset dir="${gwt.home}" includes="gwt-dev-${gwt.flavour}.jar"/>
</path>
<target name="all" depends="clean,dist" description="Compile/generate all client-side and server-side content"/>
<target name="clean" description="Delete all build artifacts">
<delete dir="build"/>
<delete dir="www"/>
<delete dir="bin"/>
<delete dir="tomcat"/>
<delete file="${ant.project.name}.war" />
</target>
<target name="compile" description="Compile Java classes required on serverside">
<mkdir dir="build/classes"/>
<javac classpathref="compile-classpath" sourcepath="" srcdir="src" destdir="build/classes">
<!-- * Your GWT structure should following the GWT default one, Otherwise, change here *-->
<include name="**/server/**/*.java"/>
<include name="**/client/**/*.java"/>
</javac>
</target>
<target name="gwt-compile" description="Generate clientside content with GWT">
<mkdir dir="www"/>
<java classpathref="gwt-classpath" classname="com.google.gwt.dev.GWTCompiler" fork="true">
<classpath>
<pathelement path="src"/>
<fileset dir="${gwt.home}">
<include name="**/*.jar"/>
</fileset>
</classpath>
<arg value="-out"/>
<arg value="www"/>
<arg value="-style"/>
<arg value="DETAILED"/>
<!-- * your GWT project package *
<arg value="com.maqujun.too.handsome.Handsome"/>
-->
<arg value="hello.HelloGWT"/>
</java>
</target>
<target name="gwt-shell" description="Launch App in GWT shell" depends="compile">
<java classpathref="gwt-classpath" classname="com.google.gwt.dev.GWTShell" fork="true">
<classpath>
<pathelement path="src"/>
<pathelement path="bin/classes"/>
<fileset dir="lib" includes="*.jar"/>
</classpath>
<arg value="-out"/>
<arg value="www"/>
<!-- * your GWT project package and html path* -->
<arg value="hello.HelloGWT/HelloGWT.html"/>
</java>
</target>
<target name="dist" description="Package the web-application for deployment" depends="compile,gwt-compile">
<war destfile="${ant.project.name}.war" webxml="webapp/WEB-INF/web.xml" >
<lib dir="lib" includes="*.jar"/>
<classes dir="build/classes"/>
<!-- * your GWT project package * -->
<fileset dir="www/hello.HelloGWT" excludes="**/*.gwt.xml"/>
</war>
</target>
</project>