复制代码代码如下:
<?xml版本=“ 1.0” encoding =“ utf-8”?>
<项目名称=“ Hello world” default =“ doc”基础=“。”>
<! - 属性 - >
<propertyName =“ src.dir” value =“ src”> </property>
<propertyName =“ report.dir” value =“ report”> </property>
<propertyName =“ class.dir” value =“ class”> </property>
<propertyName =“ lib.dir” value =“ lib”> </property>
<propertyName =“ dist.dir” value =“ dist”> </property>
<propertyName =“ doc.dir” value =“ doc”> </property>
<propertyName =“ jar.name” value =“ hello.jar”> </property>
<propertyName =“ war.name” value =“ hello.war”> </property>
<propertyName =“ webcontent” value =“ webcontent”> </property>
<propertyName =“ war.dir” value =“ war”> </property>
<! - 定义classPath->
<pathID =“ master-classPath”>
<filesEtFile =“ $ {lib.dir}/*。jar”/>
<pathElementPath =“ $ {class.dir}”> </pathElement>
</path>
<! - 初始化任务->
<targetName =“ init”>
<deletedir =“ $ {lib.dir}”> </delete>
<deletedir =“ $ {dist.dir}”> </delete>
<deletedir =“ $ {doc.dir}”> </delete>
<deletedir =“ $ {war.dir}”> </delete>
<mkdirdir =“ $ {src.dir}”> </mkdir>
<mkdirdir =“ $ {report.dir}”> </mkdir>
<mkdirdir =“ $ {class.dir}”> </mkdir>
<mkdirdir =“ $ {lib.dir}”> </mkdir>
<mkdirdir =“ $ {dist.dir}”> </mkdir>
<mkdirdir =“ $ {doc.dir}”> </mkdir>
<mkdirdir =“ $ {war.dir}”> </mkdir>
<eChoMessage =“ 初始化完成!”> </echo>
</target>
<! - 编译->
<targetName =“ compile”依赖=“ init” descript =“ CompileThesourceFiles”>
<javacsrcdir =“ $ {src.dir}” destdir =“ $ {class.dir}” includeAntruntime =“ on”>
<ClassPathRefid =“ Master-ClassPath”> </classPath>
</javac>
</target>
<! - 打包成jar->
<targetName =“ pack”依赖=“ compile” descript =“ make.jarfile”>
<jardestfile =“ $ {dist.dir}/$ {jar.name}”基础=“ $ {class.dir}”>
</jar>
</target>
<! - 打成战 - >
<targetName =“战争”依赖=“ pack”>
<WardestFile =“ $ {war.dir}/$ {war.name}” webxml =“ $ {webcontent}/web-inf/web.xml”>
<filesetdir =“ $ {war.dir}”/>
<libdir =“ $ {webcontent}/web-inf/lib”/>
<classDir =“ $ {class.dir}”> </class>
</war>
</target>
<! - 输出api文档->
<targetName =“ doc”依赖=“战争”描述=“ createapidoc”>
<javadocdestdir =“ $ {doc.dir}”作者=“ ture”版本=“ ture” use =“ ture” window title =“ helloworldapi”>
<packagesEtdir =“ $ {src.dir}” defaultExcludes =“ yes”>
<includeName =“示例/**”/>
</packageset>
<Doctitle> <![CDATA [<H1>您好,World </h1>]]> </doctitle>
<bottom> <![cdata [<i> allightservered </i>]]> </bottom>
<tagname =“ todo”范围=“ all” descript =“ todo:”/>
</javadoc>
</target>
</project>