- 什么是ant中的task
ant通过任务实现其功能,比如:编译通过javac任务实现,打jar包通过jar任务完成等等 - ant中的常用任务:
- javac:编译java代码
- jar:打包class文件为jar
- war:为web项目打包
- zip:打包为zip文件
- copy:复制文件或目录
- delete:删除文件或目录
- mkdir:创建文件夹
- echo:输出信息
- ftp:通过ftp传输文件
- scp:通过scp传输文件
- exec执行命令
- 以上列出了ant中最常用的任务,更全的任务列表请参考这里
Given the large number of tasks available with Ant, it may bedifficult to get an overall view of what each task can do. The followingtables provide a short description of each task and a link to the completedocumentation.
Archive Tasks
Audit/Coverage Tasks
Compile Tasks
Deployment Tasks
Documentation Tasks
EJB Tasks
Execution Tasks
File Tasks
Java2 Extensions Tasks
Logging Tasks
Mail Tasks
Miscellaneous Tasks
Pre-process Tasks
Property Tasks
Remote Tasks
SCM Tasks
Testing Tasks
Archive Tasks [Back to top] Task Name Description BUnzip2 Expands a file packed using GZip or BZip2.
BZip2 Packs a file using the GZip or BZip2 algorithm. This task does not do any dependency checking; the output file is always generated
Cab Creates Microsoft CAB archive files. It is invoked similar to the Jar or Zip tasks. This task will work on Windows using the externalcabarc tool (provided by Microsoft), which must be located in your executable path.
Ear An extension of the Jar task with special treatment for files that should end up in an Enterprise Application archive.
GUnzip Expands a GZip file.
GZip GZips a set of files.
Jar Jars a set of files.
Jlink Deprecated. Use the
zipfileset
andzipgroupfileset
attributes of theJar or Zip tasks instead.Manifest Creates a manifest file.
Rpm Invokes the rpm executable to build a Linux installation file. This task currently only works on Linux or other Unix platforms with RPM support.
SignJar Signs a jar or zip file with the javasign command-line tool.
Tar Creates a tar archive.
Unjar Unzips a jarfile.
Untar Untars a tarfile.
Unwar Unzips a warfile.
Unzip Unzips a zipfile.
War An extension of the Jar task with special treatment for files that should end up in the
WEB-INF/lib
,WEB-INF/classes
, orWEB-INF
directories of the Web Application Archive.Zip Creates a zipfile.
Audit/Coverage Tasks [Back to top] Task Name Description JDepend Invokes the JDepend parser. This parser "traverses a set of Java source-file directories and generates design-quality metrics for each Java package".
Compile Tasks [Back to top] Task Name Description Depend Determines which classfiles are out-of-date with respect to their source, removing the classfiles of any other classes that depend on the out-of-date classes, forcing the re-compile of the removed classfiles. Typically used in conjunction with theJavac task.
Javac Compiles the specified source file(s) within the running (Ant) VM, or in another VM if the
fork
attribute is specified.Apt Runs the annotation processor tool (apt), and then optionally compiles the original code, and any genera
ant实用手册(三)——ant中的task
最新推荐文章于 2020-07-30 14:23:11 发布