ant build.xml
来源:互联网 发布:冰箱什么牌子静音 知乎 编辑:程序博客网 时间:2024/06/05 19:46
<?xml version="1.0" encoding="UTF-8"?>
<project name="web" default="deploy" basedir="." >
<property name="src.dir" value="src" description="项目本身src"/>
<property name="webcontent.dir" value="WebContent" description="项目本身"/>
<property name="lib.dir" value="WEB-INF/lib"/>
<property name="web-inf.dir" value="${webcontent.dir}/WEB-INF"/>
<property name="build.dir" value="build" description="存放生成的class"/>
<property name="dist.dir" value="dist" description="存放war和javac"/>
<property name="tomcat.home" value="D:\servers\apache-tomcat-7.0.61/webapps" description="tomcat webapps路径"/>
<path id="project.classpath" description="jar路径">
<fileset dir="${webcontent.dir}/${lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="D:\servers\apache-tomcat-7.0.61/lib">
<include name="*.jar"/>
</fileset>
</path>
<target name="clean">
<delete dir="${build.dir}"></delete>
<delete dir="${dist.dir}"></delete>
<delete file="${tomcat.home}/${ant.project.name}.war"></delete>
<delete dir="${tomcat.home}/${ant.project.name}"></delete>
</target>
<target name="init" depends="clean">
<mkdir dir="${build.dir}/classes"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="compile" depends="init" description="编译java文件">
<javac srcdir="${src.dir}" destdir="${build.dir}/classes" includeantruntime="true">
<compilerarg line="-encoding UTF-8"/>
<classpath refid="project.classpath"></classpath>
</javac>
<copy todir="${build.dir}/classes">
<fileset dir="${src.dir}">
<include name="*.xml"/>
<include name="*.jar"/>
<include name="*.properties"/>
</fileset>
</copy>
</target>
<target name="build-war" depends="compile">
<war destfile="${dist.dir}/${ant.project.name}.war" basedir="${webcontent.dir}" webxml="${web-inf.dir}/web.xml">
<classes dir="${build.dir}/classes"></classes>
<lib dir="${webcontent.dir}/${lib.dir}"></lib>
<fileset dir="WebContent"/>
</war>
</target>
<target name="deploy" depends="compile">
<copy todir="${tomcat.home}/${ant.project.name}">
<fileset dir="${webcontent.dir}"/>
</copy>
<copy todir="${tomcat.home}/${ant.project.name}/WEB-INF/classes">
<fileset dir="${build.dir}/classes"/>
</copy>
</target>
</project>
<project name="web" default="deploy" basedir="." >
<property name="src.dir" value="src" description="项目本身src"/>
<property name="webcontent.dir" value="WebContent" description="项目本身"/>
<property name="lib.dir" value="WEB-INF/lib"/>
<property name="web-inf.dir" value="${webcontent.dir}/WEB-INF"/>
<property name="build.dir" value="build" description="存放生成的class"/>
<property name="dist.dir" value="dist" description="存放war和javac"/>
<property name="tomcat.home" value="D:\servers\apache-tomcat-7.0.61/webapps" description="tomcat webapps路径"/>
<path id="project.classpath" description="jar路径">
<fileset dir="${webcontent.dir}/${lib.dir}">
<include name="*.jar"/>
</fileset>
<fileset dir="D:\servers\apache-tomcat-7.0.61/lib">
<include name="*.jar"/>
</fileset>
</path>
<target name="clean">
<delete dir="${build.dir}"></delete>
<delete dir="${dist.dir}"></delete>
<delete file="${tomcat.home}/${ant.project.name}.war"></delete>
<delete dir="${tomcat.home}/${ant.project.name}"></delete>
</target>
<target name="init" depends="clean">
<mkdir dir="${build.dir}/classes"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="compile" depends="init" description="编译java文件">
<javac srcdir="${src.dir}" destdir="${build.dir}/classes" includeantruntime="true">
<compilerarg line="-encoding UTF-8"/>
<classpath refid="project.classpath"></classpath>
</javac>
<copy todir="${build.dir}/classes">
<fileset dir="${src.dir}">
<include name="*.xml"/>
<include name="*.jar"/>
<include name="*.properties"/>
</fileset>
</copy>
</target>
<target name="build-war" depends="compile">
<war destfile="${dist.dir}/${ant.project.name}.war" basedir="${webcontent.dir}" webxml="${web-inf.dir}/web.xml">
<classes dir="${build.dir}/classes"></classes>
<lib dir="${webcontent.dir}/${lib.dir}"></lib>
<fileset dir="WebContent"/>
</war>
</target>
<target name="deploy" depends="compile">
<copy todir="${tomcat.home}/${ant.project.name}">
<fileset dir="${webcontent.dir}"/>
</copy>
<copy todir="${tomcat.home}/${ant.project.name}/WEB-INF/classes">
<fileset dir="${build.dir}/classes"/>
</copy>
</target>
</project>
0 0
- ANT Build.xml例子
- Ant build.xml sample
- Apache Ant Build.xml
- ANT-build.xml详解
- ant & build.xml详解
- ant build.xml
- ANT Build.xml例子
- ANT build.xml详解
- Ant build.xml
- ant build.xml study
- Ant 入门 Build.xml
- Ant build.xml 模板
- Ant配置文件build.xml
- ANT-Build.xml
- MyEclipse Ant build.xml
- ant-build.xml说明- -
- Ant build.xml 模版
- Ant build.xml (模板)
- 结束终端
- android studio内存分析初探
- Arch
- @SuppressWarnings(unchecked)作用解释文档
- Base64和3DES加密算法原理
- ant build.xml
- weblogic集群负载分发模块mod_wl_22.so参数说明
- Spring 实现容器销毁该bean的时候获得一次回调
- iDLNA
- 浏览器对象
- 在centos7/ubuntu15.04 上通过bosh-lite 搭建单机环境Cloud Foundry
- IE6中CSS方法实现PNG图片透明
- poj 3254 Corn Fields
- Serivce通知Activity更新UI方法总结