所需的软件:
ant,j2sdk,j2ee.
我的环境变量设置(我定义在用户变量中):
J2EE_HOME=f:\j2sdkee1.3.1 JAVA_HOME=f:\j2sdk1.4.1_01 JBOSS_HOME=f:\jboss
Path=.;f:\j2sdk1.4.1_01\bin;f:\j2sdkee1.3.1\bin;f:\ant1.5.2\bin
CLASSPATH=.;f:\j2sdk1.4.1_01\lib\dt.jar;f:\j2sdk1.4.1_01\lib\tools.jar;f:\j2sdkee1.3.1\lib\j2ee.jar
我的模板项目的结构和文件内容,便于以后拷贝。
build.xml
<?xml version="1.0"?>
<!-- ======================================================================= -->
<!-- Template build file -->
<!-- ======================================================================= -->
<project name="template" default="main" basedir=".">
<!--
Give user a chance to override without editing this file
(and without typing -D each time they run it)
-->
<property file=".ant.properties" />
<property file="${user.home}/.ant.properties" />
<property name="Name" value="Template"/>
<property name="version" value="1.1"/>
<target name="check-jboss" unless="jboss.home">
<fail>
Property "jboss.home" is not set. Please use the file
".ant.properties" in this directory ${basedir} to
set this property. It must point to the directory which
contains the following directory: "deploy", "conf", "tmp"
etc.
</fail>
</target>
<target name="wrong-jboss" unless="jboss.present">
<fail>
Property "jboss.home" is set but it does not seem
to point to the right directory. The file "run.jar"
must be available at ${jboss.home}/bin.
</fail>
</target>
<target name="check-environment">
<antcall target="check-jboss"/>






