java构建与管理(1) - Apache Ant Short History
2015-09-23 14:18
387 查看
#1. Install Apache Ant
#2. Using Apache Ant
#3. Running Apache Ant
<!-- 1. Make sure you have a Java environment installed, See System Requirements for details. 2. Download Ant. http://ant.apache.org/ 3. Uncompress the downloaded file into a directory. 4. Set environmental variables JAVA_HOME to your Java environment, ANT_HOME to the directory you uncompressed Ant to, and add ${ANT_HOME}/bin (Unix) or %ANT_HOME%/bin (Windows) to your PATH. 5. Optionally, from the ANT_HOME directory run ant -f fetch.xml -Ddest=system to get the library dependencies of most of the Ant tasks that require them. If you don't do this, many of the dependent Ant tasks will not be available. 6. Optionally, add any desired Antlibs. -->
#2. Using Apache Ant
<project name="MyProject" default="dist" basedir="."> <description>simple example build file</description> <!-- set global properties for this build --> <property name="src" location="src"/> <property name="build" location="build"/> <property name="dist" location="dist"/> <target name="init"> <!-- Create the time stamp --> <tstamp/> <!-- Create the build directory structure used by compile --> <mkdir dir="${build}"/> </target> <target name="compile" depends="init" description="compile the source"> <!-- Compile the java code from ${src} into ${build} --> <javac srcdir="${src}" destdir="${build}"/> </target> <target name="dist" depends="compile" description="generate the distribution"> <!-- Create the distribution directory --> <mkdir dir="${dist}/lib"/> <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --> <jar jarfile="${dist}/lib/MyProject-${DSTAMP}.jar" basedir="${build}"/> </target> <target name="clean" description="clean up"> <!-- Delete the ${build} and ${dist} directory trees --> <delete dir="${build}"/> <delete dir="${dist}"/> </target> </project>
#3. Running Apache Ant
<!-- ant [options] [target1 [target2 [target3]]] Options: -help, -h print this message and exit -projecthelp, -p print project help information and exit -version print the version information and exit -diagnostics print information that might be helpful to diagnose or report problems and exit -quiet, -q be extra quiet -silent, -S print nothing but task outputs and build failure -verbose, -v be extra verbose -debug, -d print debugging information -emacs, -e produce logging information without adornments -lib <path> specifies a path to search for jars and classes -logfile <file>, -l <file> use given file for log -logger <classname> the class which is to perform logging -listener <classname> add an instance of class as a project listener -noinput do not allow interactive input -buildfile <file>, -file <file>, -f <file> use given build file -D<property>=<value> use value for given property -keep-going, -k execute all targets that do not depend on failed target(s) -propertyfile <name> load all properties from file with -D properties taking precedence -inputhandler <class> the class which will handle input requests -find <file>, -s <file> (s)earch for buildfile towards the root of the filesystem and use it -nice number A niceness value for the main thread: 1 (lowest) to 10 (highest); 5 is the default -nouserlib Run ant without using the jar files from ${user.home}/.ant/lib -noclasspath Run ant without using CLASSPATH -autoproxy Java 1.5+ : use the OS proxies -main <class> override Ant's normal entry point -->
相关文章推荐
- apache-archiva-2.2.0 密码过期问题的解决
- Hustoj关闭Apache的目录浏览功能
- 【学习笔记】系列二:Linux安装配置apache
- Apache 无法正常启动问题
- 揭秘Apache顶级项目大数据分析引擎 Flink:与Spark的对比与分析
- Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart
- Apache SSI配置 动态include静态html文件
- 使用LoadRunner监控Apache的步骤 (转)
- Datastax文档Apache Cassandra v2.1 第二部分 理解Cassandra架构_数据分发和副本
- APACHE服务实验
- CentOs中Apache开启rewrite模块详解
- apache kafka系列之log4j配置
- apache kafka系列之在zookeeper中存储结构
- CentOS Apache虚拟主机配置
- org.apache.subversion.javahl.ClientException: svn: E155021: This client is too old to work with the
- Apache经常使用配置
- apache搭建
- Apache2.4+php5.6+Mysql5.6+Mantisbt 配置
- apache virtualhost 针对ip开放访问
- apache日志分析