ant部署GWT项目

使用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>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值