这是bank里的build.xml:<!DOCTYPE project [
<!ENTITY targets SYSTEM "../common/targets.xml">
]><project name="j2ee-tutorial-app" default="build" basedir=".">
<property file="../common/build.properties"/>
<property file="build.properties"/> &targets;<!-- ====================== PREPARE =================== --> <target name="init">
<tstamp/>
</target> <target name="prepare" depends="init">
<mkdir dir="${build}" />
</target><!-- ====================== COMPILE =================== --> <target name="compile-exception"
depends="prepare">
<javac srcdir="${src}" destdir="${build}" >
<include name="**/exception/*"/>
<classpath refid="classpath" />
</javac>
</target> <target name="compile-detail"
depends="prepare">
<javac srcdir="${src}" destdir="${build}" >
<include name="**/util/*Details.java"/>
<classpath refid="classpath" />
</javac>
</target> <target name="compile-interface"
depends="compile-detail,compile-exception">
<javac srcdir="${src}" destdir="${build}">
<include name="**/ejb/**/**"/>
<exclude name="**/ejb/**/*Bean.java,**/ejb/exception/***,**/ejb/test/**"/>
<classpath refid="classpath" />
</javac>
</target>
<target name="compile-util"
depends="compile-interface">
<javac srcdir="${src}" destdir="${build}" >
<include name="**/ebank/util/**"/>
<classpath refid="classpath" />
</javac>
</target> <target name="compile-ejb"
depends="compile-util">
<javac srcdir="${src}" destdir="${build}" >
<include name="**/ebank/ejb/**/*Bean*"/>
<classpath refid="classpath" />
</javac>
</target> <target name="compile-web">
<javac debug="on" srcdir="${src}" destdir="${build}">
<include name="**/web/**"/>
<exclude name="**/*.properties" />
<classpath refid="classpath" />
</javac>
<copy todir="${build}">
<fileset dir="web">
<include name="**/*.html" />
<include name="**/*.jsp" />
<include name="**/*.jspf" />
<include name="**/*.gif" />
<include name="**/*.xml" />
<include name="**/*.tld" />
<include name="**/*.tag" />
</fileset>
</copy>
<copy todir="${build}">
<fileset dir="web">
<include name="**/*.properties" />
</fileset>
</copy>
</target>
<target name="compile-ac"
depends="compile-util">
<javac srcdir="${src}" destdir="${build}">
<include name="**/appclient/**"/>
<exclude name="**/*.properties" />
<classpath refid="classpath" />
</javac>
<copy todir="${build}">
<fileset dir="${src}">
<include name="**/appclient/*.properties" />
</fileset>
</copy>
</target>
<target name="build"
depends="compile-ejb,compile-ac,compile-web">
</target>
<!-- ====================== DATABASE =================== --> <target name="db-create-table" depends="init"
description="Create database tables and seed id tables." >
<property name="sql.script" value="${sql}/create-table.sql"/>
<antcall target="create-db_common"/>
</target>
<target name="db-insert" depends="init"
description="Populate database." >
<property name="sql.script" value="${sql}/insert.sql"/>
<antcall target="create-db_common"/>
</target>
<target name="db-list" depends="init"
description="List accounts (for debugging)." >
<property name="sql.script" value="${sql}/listAccount.sql"/>
<antcall target="create-db_common"/>
</target>
<target name="db-delete" depends="init"
description="Delete all rows in all tables except id tables." >
<property name="sql.script" value="${sql}/delete.sql"/>
<antcall target="create-db_common"/>
</target>
<target name="db-reset-key" depends="init"
description="Reset id tables (for debugging)." >
<property name="sql.script" value="${sql}/reset-key.sql"/>
<antcall target="create-db_common"/>
</target>
</project>
<!ENTITY targets SYSTEM "../common/targets.xml">
]><project name="j2ee-tutorial-app" default="build" basedir=".">
<property file="../common/build.properties"/>
<property file="build.properties"/> &targets;<!-- ====================== PREPARE =================== --> <target name="init">
<tstamp/>
</target> <target name="prepare" depends="init">
<mkdir dir="${build}" />
</target><!-- ====================== COMPILE =================== --> <target name="compile-exception"
depends="prepare">
<javac srcdir="${src}" destdir="${build}" >
<include name="**/exception/*"/>
<classpath refid="classpath" />
</javac>
</target> <target name="compile-detail"
depends="prepare">
<javac srcdir="${src}" destdir="${build}" >
<include name="**/util/*Details.java"/>
<classpath refid="classpath" />
</javac>
</target> <target name="compile-interface"
depends="compile-detail,compile-exception">
<javac srcdir="${src}" destdir="${build}">
<include name="**/ejb/**/**"/>
<exclude name="**/ejb/**/*Bean.java,**/ejb/exception/***,**/ejb/test/**"/>
<classpath refid="classpath" />
</javac>
</target>
<target name="compile-util"
depends="compile-interface">
<javac srcdir="${src}" destdir="${build}" >
<include name="**/ebank/util/**"/>
<classpath refid="classpath" />
</javac>
</target> <target name="compile-ejb"
depends="compile-util">
<javac srcdir="${src}" destdir="${build}" >
<include name="**/ebank/ejb/**/*Bean*"/>
<classpath refid="classpath" />
</javac>
</target> <target name="compile-web">
<javac debug="on" srcdir="${src}" destdir="${build}">
<include name="**/web/**"/>
<exclude name="**/*.properties" />
<classpath refid="classpath" />
</javac>
<copy todir="${build}">
<fileset dir="web">
<include name="**/*.html" />
<include name="**/*.jsp" />
<include name="**/*.jspf" />
<include name="**/*.gif" />
<include name="**/*.xml" />
<include name="**/*.tld" />
<include name="**/*.tag" />
</fileset>
</copy>
<copy todir="${build}">
<fileset dir="web">
<include name="**/*.properties" />
</fileset>
</copy>
</target>
<target name="compile-ac"
depends="compile-util">
<javac srcdir="${src}" destdir="${build}">
<include name="**/appclient/**"/>
<exclude name="**/*.properties" />
<classpath refid="classpath" />
</javac>
<copy todir="${build}">
<fileset dir="${src}">
<include name="**/appclient/*.properties" />
</fileset>
</copy>
</target>
<target name="build"
depends="compile-ejb,compile-ac,compile-web">
</target>
<!-- ====================== DATABASE =================== --> <target name="db-create-table" depends="init"
description="Create database tables and seed id tables." >
<property name="sql.script" value="${sql}/create-table.sql"/>
<antcall target="create-db_common"/>
</target>
<target name="db-insert" depends="init"
description="Populate database." >
<property name="sql.script" value="${sql}/insert.sql"/>
<antcall target="create-db_common"/>
</target>
<target name="db-list" depends="init"
description="List accounts (for debugging)." >
<property name="sql.script" value="${sql}/listAccount.sql"/>
<antcall target="create-db_common"/>
</target>
<target name="db-delete" depends="init"
description="Delete all rows in all tables except id tables." >
<property name="sql.script" value="${sql}/delete.sql"/>
<antcall target="create-db_common"/>
</target>
<target name="db-reset-key" depends="init"
description="Reset id tables (for debugging)." >
<property name="sql.script" value="${sql}/reset-key.sql"/>
<antcall target="create-db_common"/>
</target>
</project>
在cmd下输入ant -version看看有没有ant版本的输出,如果没有那么说明ant没有配好。ant的配法:
1。解压ant的包到本地目录。
2。在环境变量中设置ANT_HOME,值为你的安装目录。
3。在环境变量中设置JAVA_HOME,值为你的jdk安装目录。
4。把ANT_HOME/bin加到你系统的path目录中去。
ANT_HOME:D:\apache-ant-1.6alpha-bin\apache-ant-1.6alphaJAVA_HOME:F:\tools\j2sdk1.4.1_02path:F:\TOOLS\RATIONAL\RATION~1\NUTCROOT\bin;F:\TOOLS\RATIONAL\RATION~1\NUTCROOT\bin\x11;F:\TOOLS\RATIONAL\RATION~1\NUTCROOT\mksnt;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;F:\tools\j2sdk1.4.1_02\bin;E:\JAVA\jspServlet\jakarta-tomcat-4.1.24\bin;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;F:\tools\Rational\common;F:\tools\Rational\ClearQuest;F:\tools\Rational\Rose\TopLink\;F:\tools\Rational\Rational Test;D:\apache-ant-1.6alpha-bin\apache-ant-1.6alpha\binant -version提示:
The input line is too long
:gotAllArgs
was unexpected at this time