学习了一下使用ant给web项目打包,使用ant命令预先安装ant软件,并且配置
环境变量:
ANT_HOME=ant安装目录
PATH=%PATH%;%ANT_HOME%/bin
根据http://blog.csdn.net/lip009/article/details/1226931 自己写了一个 build.xml文件
<?xml version="1.0" encoding="UTF-8"?> <project name="AntTest" basedir="." default="war"> <description> This is a description for AntTest </description> <!-- 设置一些变量 --> <property name="webroot" location="WebRoot"></property> <property name="classes.dir" location="${webroot}/WEB-INF/classes"></property> <property name="lib.dir" location="${webroot}/WEB-INF/lib"></property> <property name="dist.dir" location="dist"></property> <property name="config.dir" location="config"></property> <path id="classpath"> <fileset dir="${classes.dir}"></fileset> <fileset dir="${lib.dir}"></fileset> </path> <target name="init-dir" > <mkdir dir="${classes.dir}"/> <mkdir dir="${lib.dir}"/> <mkdir dir="${dist.dir}"/> <echo>创建目录,完成.</echo> </target> <target name="src-compile"> <javac target="1.6" srcdir="src" destdir="${classes.dir}" classpathref="classpath" includeantruntime="false"> <!-- 设置编码方式,否则控制台乱码 --> <compilerarg line="-encoding UTF-8"/> </javac> <echo>编译文件,完成.</echo> </target> <target name="copy-config"> <copy todir="${classes.dir}"> <fileset dir="${config.dir}" includes="**/*.*"></fileset> </copy> <echo>拷贝配置文件到classes下,完成.</echo> </target> <target name="war" depends="init-dir,src-compile,copy-config"> <war destfile="${dist.dir}/${ant.project.name}.war" basedir="${webroot}"></war> <echo>生成War包,完成.</echo> </target> </project>这只是最简单的一个buil.xml 了,如果要打jar包,还可以在里面加.
相关推荐
使用Ant编译打包
Ant编译打包android工程,签名,多渠道
使用ant编译打包应用程序,比较简单,适合初学者。
介绍了如何通过ant进行java web工程的编译操作的详细配置
通过ant脚本,编译打包android工程。 编译打包android工程的ant脚本,Android官方提供的打包脚本。 有注释
因为项目的需要必须写一个ANDROID_ANT自动编译打包签名的脚本,终于奋斗了几天写完了,和大家分享一下
NULL 博文链接:https://shawnfree.iteye.com/blog/346466
此文档为ANT编译打包相关的文档,有截图,手把手教如何用
一个普通java程序用ant打包的列子,完整的,里面采用的是eclipse自带的编译插件进行的打包,需要结合eclipse中的插件一起使用
Ant学习笔记Ant学习笔记Ant学习笔记
ant 编译、打包、部署项目的build文件
ant标签说明、ant案例、ant与eclipse工具配置以及使用
ant 编译jar包
Ant编译后的zookeeper源码 版本:zookeeper-release-3.4.11、apache-ant-1.9.14 可直接导入eclipse或idea
ant脚本编译出jar
ANT配置,打包,编译
SVN+ant 服务器代码打包编译流程详解,内含详细安装以及操作说明build.xml+build.properties详解,可以直接修改路径后打包编译SVN代码。
在Java 中应用是平台无关性的,当然不会用平台相关的make脚本来完成这些批处理任务了,ANT本身就是这样一个流程脚本引擎,用于自动化调用程序完成项目的编译,打包,测试等。本文介绍了android编译和ant打包原理
ant 是一个编译打包工具 只需解压便可使用 下载后有两个文件: apache-ant-1.8.2-src.zip 是源文件发布 apache-ant-1.8.2-bin.zip 是二进制发布