<?xml version="1.0" encoding="UTF-8"?>
<project name="newDemo" default="openExplorer" basedir=".">
<!--基础设置-->
<property name="project.name" value="newDemo" />
<property name="src.dir" value="src" />
<property name="web.dir" value="WebContent" />
<property name="build.dir" value="${web.dir}/WEB-INF/classes" />
<property name="lib.dir" value="${web.dir}/WEB-INF/lib" />
<property name="dist.dir" value="dist" />
<property name="dist.version" value="1.0.0" />
<property name="tomcat.home" value="D:/Program Files/apache-tomcat-7.0.5/"/>
<!--类库路径-->
<path id="classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<!--初始化-->
<target name="init">
<echo message="beginning ant tasks" />
</target>
<!--清除旧文件-->
<target name="clean" depends="init" description="remove all old files">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
</target>
<!--新建编译目录-->
<target name="prepare" depends="clean">
<echo message="mkdir WebContent/WEB-INF/classes" />
<mkdir dir="${build.dir}" />
</target>
<!--拷贝不需要编译的文件到build.dir-->
<target name="copy" depends="prepare" description="copy *.xml *.properties etc file to build path">
<copy todir="${build.dir}" overwrite="true">
<fileset dir="${src.dir}">
<include name="**/*.xml" />
<include name="**/*.properties" />
<include name="**/*.xlsx" />
</fileset>
</copy>
</target>
<!--编译源代码-->
<target name="complie" depends="copy" description="complies all src files">
<javac srcdir="${src.dir}" destdir="${build.dir}" includes="**/*.java" encoding="UTF-8" debug="true">
<classpath refid="classpath" />
</javac>
<echo message="complie completed !" />
</target>
<!--打包war包-->
<target name="war" depends="complie" description="compress war file">
<mkdir dir="${dist.dir}" />
<war warfile="${dist.dir}/newDemo.war">
<fileset dir="${web.dir}">
</fileset>
</war>
<echo message="build war ok...." />
</target>
<!--将war包拷贝到tomcat/-->
<target name="copyTotomcat" depends="war" description="copy war to tomcat...">
<copy todir="${tomcat.home}/webapps" overwrite="true">
<fileset dir="${dist.dir}">
<include name="**/*.war" />
</fileset>
</copy>
<echo message="copy war to tomcat ok...." />
</target>
<!--stop tomcat/-->
<target name="stopTomcat" depends="copyTotomcat">
<exec executable="${tomcat.home}/bin/shutdown.bat" spawn="true" vmlauncher="false">
<env key="CATALINA_HOME" value="${tomcat.home}" />
<arg line="/c start ${tomcat.home}/bin/shutdown.bat" />
</exec>
<echo message="stop tomcat ok...." />
</target>
<!-- start tomcat/-->
<target name="startTomcat" depends="stopTomcat" description="tomcat starting.....">
<exec executable="${tomcat.home}/bin/startup.bat" spawn="true" vmlauncher="false">
<env key="CATALINA_HOME" value="${tomcat.home}" />
<arg line="/c start ${tomcat.home}/bin/startup.bat" />
</exec>
<echo message="start tomcat ok ...." />
</target>
<!-- open browser /-->
<target name="openExplorer" depends="startTomcat" description="tomcat starting.....">
<exec executable="explorer">
<arg line="http://10.144.154.217:8080/newDemo"/>
</exec>
</target>
</project>
分享到:
相关推荐
ANT文件详解 ant介绍 ANT 命令
NULL 博文链接:https://chenhailong.iteye.com/blog/1876732
这是一个ANT自编译的程序,可以在myeclipse下创建ant文件,根据代码配置,下载后直接可以用。
ant的配置文件ant的配置文件ant的配置文件ant的配置文件
Project元素是Ant文件的根元素,Ant构建文件中至少应该包含一个project元素,否则会发生错误。在每个project元素下面可以包含多个target元素。project的属性包括: name : 项目名称 default:当调用时没有指定...
NULL 博文链接:https://lgstarzkhl.iteye.com/blog/627619
Ant 配置文件详解 Ant 各种详细配置应有尽有!!!
ant 配置文件集合
这是一套蚂蚁设计(Antdesign)组件的sketch文档,可用于设计和产品原型
文件说明:ant文件中 key.store=加密文件 key.alias=alias名称 key.store.password=加密密码 key.alias.password=alias密码 umeng_channels=baidu,google,umeng //渠道包,用逗号分隔 output.apk.dir=F:\...
通过freemark模板制定模板文件,支持ant一键生成,内置详细的doc说明文档 内置完整的jar包。无需编译 一键生成。可结合自己的需求进行改动和调整。灵活、通用 可以完美的集成在各个项目中,下载记得好评。 有使用上...
jmeter+ant 持续集成build.xml文件,直接使用ant命令执行jmeter脚本文件,得到图形测试报告
主要介绍了Ant Design Pro 下实现文件下载的实现代码,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
ant的build配置文件;
ant的介绍pdf文件 ant的介绍pdf文件 ant的介绍pdf文件
ant环境配置,ant文件编写,ant使用技巧,ant开发实例
该程序为Ant的扩展任务,在拷贝文本格式的文件的同时替换文件中的Ant表达式,类似于 ${property.name},属性值来自于Ant脚本加载的属性文件,如果没有属性文件中没有定义相关属性,那么保留原来的表达式;...
maven下通用的ant配置文件,只要0积分。只需修改11行末尾的target/自己的工程名即可。
ant执行 target 前先判断文件是否存在,只有文件存在才执行。
ps抢红包神器