{"id":230,"date":"2026-10-12T23:51:34","date_gmt":"2026-10-12T23:51:34","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2010\/04\/14\/apache-ant-a-complete-task-reference\/"},"modified":"2026-10-12T23:51:34","modified_gmt":"2026-10-12T23:51:34","slug":"apache-ant-a-complete-task-reference","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/apache-ant-a-complete-task-reference\/","title":{"rendered":"Apache Ant Task Reference for DevOps: zip, concat, replaceregexp, checksum, and fail"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em>Originally published on 2010-04-14; fully revised and updated.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Apache Ant still appears in many enterprise Java build and release pipelines. This guide focuses on five high-impact tasks from the original post\u2014<strong>zip<\/strong>, <strong>concat<\/strong>, <strong>replaceregexp<\/strong>, <strong>checksum<\/strong>, and <strong>fail<\/strong>\u2014with clear attribute summaries and corrected, usable examples.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2010\/04\/apache-ant-a-complete-task-.png\" alt=\"Apache Ant complete task reference\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">What this reference covers<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>zip<\/strong>: package files and archives with include\/exclude and update behavior<\/li><li><strong>concat<\/strong>: merge text (or resources) into one output stream or file<\/li><li><strong>replaceregexp<\/strong>: apply regex-based edits across one or many files<\/li><li><strong>checksum<\/strong>: generate or verify digests for artifacts<\/li><li><strong>fail<\/strong>: stop builds intentionally when guard conditions are not met<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">How these tasks fit into an Ant build workflow<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A common pattern is to package, normalize, validate, and then enforce quality gates before publishing artifacts.<\/p>\n\n\n\n<pre class=\"mermaid\">\nflowchart LR\n    A[Collect build outputs] --> B[zip package artifacts]\n    B --> C[concat combine text resources]\n    C --> D[replaceregexp normalize content]\n    D --> E[checksum generate or verify]\n    E --> F{Validation passed}\n    F -- no --> G[fail stop build]\n    F -- yes --> H[Publish artifact]\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Quick comparison of the five tasks<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Task<\/th><th>Primary use<\/th><th>Important attributes<\/th><th>Typical risk if misconfigured<\/th><\/tr><\/thead><tbody><tr><td>zip<\/td><td>Create or update ZIP archives<\/td><td>destfile, basedir, includes\/excludes, update, duplicate, whenempty<\/td><td>Duplicate entries, wrong file set, charset issues<\/td><\/tr><tr><td>concat<\/td><td>Concatenate resources to file\/console<\/td><td>destfile, append, force, encoding, outputencoding, fixlastline<\/td><td>Unexpected rewrites, mixed encodings, broken line endings<\/td><\/tr><tr><td>replaceregexp<\/td><td>Regex replacement in files<\/td><td>match, replace, flags, byline, encoding<\/td><td>Over-broad substitutions, multiline surprises<\/td><\/tr><tr><td>checksum<\/td><td>Digest generation and verification<\/td><td>algorithm, fileext, property, verifyproperty, todir<\/td><td>Weak algorithm choices, ambiguous verify semantics<\/td><\/tr><tr><td>fail<\/td><td>Stop build with explicit reason<\/td><td>message, if, unless, status<\/td><td>Silent pipeline continuation when checks are missing<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Apache Ant zip task<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>zip<\/strong> task creates ZIP archives and supports include\/exclude patterns and nested file sets. The original reference also notes ZIP timestamp granularity (2 seconds), default duplicate handling (<em>add<\/em>), and that filename encoding defaults to the platform encoding unless set explicitly.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Attribute<\/th><th>What it controls<\/th><th>Default \/ note<\/th><\/tr><\/thead><tbody><tr><td>destfile<\/td><td>Output ZIP file path<\/td><td>Preferred attribute (zipfile is deprecated)<\/td><\/tr><tr><td>basedir<\/td><td>Base directory to package<\/td><td>Optional when nested filesets are used<\/td><\/tr><tr><td>includes \/ excludes<\/td><td>Pattern-based file selection<\/td><td>Supports includesfile\/excludesfile<\/td><\/tr><tr><td>update<\/td><td>Update existing archive instead of overwrite mode<\/td><td>Default false<\/td><\/tr><tr><td>whenempty<\/td><td>Behavior when no files match<\/td><td>skip (default), fail, create<\/td><\/tr><tr><td>duplicate<\/td><td>Behavior for duplicate paths in archive<\/td><td>add (default), preserve, fail<\/td><\/tr><tr><td>encoding<\/td><td>Filename encoding inside archive<\/td><td>Default platform encoding<\/td><\/tr><tr><td>roundup<\/td><td>Round file timestamps to ZIP granularity<\/td><td>Default true<\/td><\/tr><tr><td>level<\/td><td>Compression level 0..9<\/td><td>Available since Ant 1.7 (per original reference)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">zip<\/span> <span class=\"hljs-attr\">destfile<\/span>=<span class=\"hljs-string\">\"${dist}\/manual.zip\"<\/span> <span class=\"hljs-attr\">basedir<\/span>=<span class=\"hljs-string\">\"htdocs\/manual\"<\/span>\/&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">zip<\/span> <span class=\"hljs-attr\">destfile<\/span>=<span class=\"hljs-string\">\"${dist}\/manual.zip\"<\/span> <span class=\"hljs-attr\">basedir<\/span>=<span class=\"hljs-string\">\"htdocs\/manual\"<\/span> <span class=\"hljs-attr\">update<\/span>=<span class=\"hljs-string\">\"true\"<\/span>\/&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">zip<\/span> <span class=\"hljs-attr\">destfile<\/span>=<span class=\"hljs-string\">\"${dist}\/docs.zip\"<\/span> <span class=\"hljs-attr\">encoding<\/span>=<span class=\"hljs-string\">\"UTF8\"<\/span> <span class=\"hljs-attr\">duplicate<\/span>=<span class=\"hljs-string\">\"fail\"<\/span> <span class=\"hljs-attr\">whenempty<\/span>=<span class=\"hljs-string\">\"fail\"<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">fileset<\/span> <span class=\"hljs-attr\">dir<\/span>=<span class=\"hljs-string\">\"htdocs\/manual\"<\/span> <span class=\"hljs-attr\">includes<\/span>=<span class=\"hljs-string\">\"api\/**\/*.html\"<\/span> <span class=\"hljs-attr\">excludes<\/span>=<span class=\"hljs-string\">\"**\/todo.html\"<\/span>\/&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">zip<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\">For encoding values, the original article pointed to the historical Java encoding list: <a href=\"http:\/\/java.sun.com\/j2se\/1.5.0\/docs\/guide\/intl\/encoding.doc.html\">http:\/\/java.sun.com\/j2se\/1.5.0\/docs\/guide\/intl\/encoding.doc.html<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Apache Ant concat task<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>concat<\/strong> merges one or more resources into a single destination file, or writes to the console if no destination is given. The original reference notes behavior for append, force, encoding, and line ending normalization.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Attribute<\/th><th>Purpose<\/th><th>Default \/ note<\/th><\/tr><\/thead><tbody><tr><td>destfile<\/td><td>Output file<\/td><td>If omitted, output goes to console<\/td><\/tr><tr><td>append<\/td><td>Append to existing destination<\/td><td>no<\/td><\/tr><tr><td>force<\/td><td>Write even when destination is newer<\/td><td>yes<\/td><\/tr><tr><td>encoding<\/td><td>Input encoding<\/td><td>Platform default<\/td><\/tr><tr><td>outputencoding<\/td><td>Output encoding<\/td><td>encoding value or JVM default<\/td><\/tr><tr><td>fixlastline \/ eol<\/td><td>Normalize final newline per input<\/td><td>fixlastline defaults to no<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">concat<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">fileset<\/span> <span class=\"hljs-attr\">dir<\/span>=<span class=\"hljs-string\">\"${src}\"<\/span> <span class=\"hljs-attr\">includes<\/span>=<span class=\"hljs-string\">\"**\/*.txt\"<\/span>\/&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">concat<\/span>&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">concat<\/span> <span class=\"hljs-attr\">destfile<\/span>=<span class=\"hljs-string\">\"${dist}\/combined.xml\"<\/span>\n        <span class=\"hljs-attr\">append<\/span>=<span class=\"hljs-string\">\"false\"<\/span>\n        <span class=\"hljs-attr\">force<\/span>=<span class=\"hljs-string\">\"no\"<\/span>\n        <span class=\"hljs-attr\">fixlastline<\/span>=<span class=\"hljs-string\">\"true\"<\/span>\n        <span class=\"hljs-attr\">eol<\/span>=<span class=\"hljs-string\">\"lf\"<\/span>\n        <span class=\"hljs-attr\">outputencoding<\/span>=<span class=\"hljs-string\">\"UTF-8\"<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">filelist<\/span> <span class=\"hljs-attr\">dir<\/span>=<span class=\"hljs-string\">\"${src}\"<\/span> <span class=\"hljs-attr\">files<\/span>=<span class=\"hljs-string\">\"introduction.xml,overview.xml\"<\/span>\/&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">fileset<\/span> <span class=\"hljs-attr\">dir<\/span>=<span class=\"hljs-string\">\"${src}\/sections\"<\/span> <span class=\"hljs-attr\">includes<\/span>=<span class=\"hljs-string\">\"*.xml\"<\/span> <span class=\"hljs-attr\">excludes<\/span>=<span class=\"hljs-string\">\"introduction.xml,overview.xml\"<\/span>\/&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">concat<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Apache Ant replaceregexp task<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>replaceregexp<\/strong> applies regex-based replacements to one file or a selected file set. Per the original notes, Ant writes output only when content changes, which helps avoid unnecessary rebuild churn.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Common flags supported in the original reference:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>g<\/strong>: replace all matches<\/li><li><strong>i<\/strong>: case-insensitive match<\/li><li><strong>m<\/strong>: multiline mode<\/li><li><strong>s<\/strong>: single-line mode where dot can match newline<\/li><\/ul>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">replaceregexp<\/span> <span class=\"hljs-attr\">file<\/span>=<span class=\"hljs-string\">\"${src}\/build.properties\"<\/span>\n               <span class=\"hljs-attr\">match<\/span>=<span class=\"hljs-string\">\"OldProperty=(.*)\"<\/span>\n               <span class=\"hljs-attr\">replace<\/span>=<span class=\"hljs-string\">\"NewProperty=\\1\"<\/span>\n               <span class=\"hljs-attr\">byline<\/span>=<span class=\"hljs-string\">\"true\"<\/span>\/&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">replaceregexp<\/span> <span class=\"hljs-attr\">match<\/span>=<span class=\"hljs-string\">\"\\s+\"<\/span> <span class=\"hljs-attr\">replace<\/span>=<span class=\"hljs-string\">\" \"<\/span> <span class=\"hljs-attr\">flags<\/span>=<span class=\"hljs-string\">\"g\"<\/span> <span class=\"hljs-attr\">byline<\/span>=<span class=\"hljs-string\">\"false\"<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">fileset<\/span> <span class=\"hljs-attr\">dir<\/span>=<span class=\"hljs-string\">\".\"<\/span> <span class=\"hljs-attr\">includes<\/span>=<span class=\"hljs-string\">\"**\/*.properties\"<\/span>\/&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">replaceregexp<\/span>&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Apache Ant checksum task<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>checksum<\/strong> generates digest files or verifies existing digests. The source explicitly warns that MD5 and SHA-1 are broken for security-sensitive uses; if integrity checks are security-critical, evaluate stronger algorithms available from your JCE provider.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Attribute or mode<\/th><th>Behavior<\/th><th>Important detail<\/th><\/tr><\/thead><tbody><tr><td>algorithm<\/td><td>Select digest algorithm<\/td><td>Default MD5 in original reference<\/td><\/tr><tr><td>fileext<\/td><td>Output extension for checksum file<\/td><td>Default uses algorithm name casing<\/td><\/tr><tr><td>property<\/td><td>Generated checksum value or expected value<\/td><td>Meaning changes when verifyproperty is set<\/td><\/tr><tr><td>verifyproperty<\/td><td>Set true\/false based on checksum match<\/td><td>No checksum file\/property written in verify mode<\/td><\/tr><tr><td>todir<\/td><td>Directory for checksum outputs<\/td><td>If omitted, checksum file is near source file<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>format value<\/th><th>Pattern<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>CHECKSUM<\/td><td>{0}<\/td><td>Checksum only<\/td><\/tr><tr><td>MD5SUM<\/td><td>{0} *{1}<\/td><td>GNU textutils style<\/td><\/tr><tr><td>SVF<\/td><td>MD5 ({1}) = {0}<\/td><td>BSD md5 style<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">checksum<\/span> <span class=\"hljs-attr\">file<\/span>=<span class=\"hljs-string\">\"foo.bar\"<\/span> <span class=\"hljs-attr\">algorithm<\/span>=<span class=\"hljs-string\">\"MD5\"<\/span>\/&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">checksum<\/span> <span class=\"hljs-attr\">file<\/span>=<span class=\"hljs-string\">\"foo.bar\"<\/span> <span class=\"hljs-attr\">algorithm<\/span>=<span class=\"hljs-string\">\"MD5\"<\/span> <span class=\"hljs-attr\">forceoverwrite<\/span>=<span class=\"hljs-string\">\"yes\"<\/span>\/&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">checksum<\/span> <span class=\"hljs-attr\">file<\/span>=<span class=\"hljs-string\">\"foo.bar\"<\/span> <span class=\"hljs-attr\">property<\/span>=<span class=\"hljs-string\">\"foobarMD5\"<\/span>\/&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">checksum<\/span> <span class=\"hljs-attr\">file<\/span>=<span class=\"hljs-string\">\"foo.bar\"<\/span> <span class=\"hljs-attr\">verifyproperty<\/span>=<span class=\"hljs-string\">\"isMD5ok\"<\/span>\/&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">checksum<\/span> <span class=\"hljs-attr\">file<\/span>=<span class=\"hljs-string\">\"foo.bar\"<\/span> <span class=\"hljs-attr\">property<\/span>=<span class=\"hljs-string\">\"${expected.md5}\"<\/span> <span class=\"hljs-attr\">verifyproperty<\/span>=<span class=\"hljs-string\">\"isEqual\"<\/span>\/&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Apache Ant fail task<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>fail<\/strong> aborts the current build with a clear message. It is commonly used as a quality gate with <em>if<\/em> \/ <em>unless<\/em> conditions and can optionally set an exit status.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml language-xml\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">fail<\/span> <span class=\"hljs-attr\">message<\/span>=<span class=\"hljs-string\">\"Something wrong here.\"<\/span>\/&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">fail<\/span> <span class=\"hljs-attr\">unless<\/span>=<span class=\"hljs-string\">\"release.ready\"<\/span> <span class=\"hljs-attr\">message<\/span>=<span class=\"hljs-string\">\"Release prerequisites not met\"<\/span> <span class=\"hljs-attr\">status<\/span>=<span class=\"hljs-string\">\"2\"<\/span>\/&gt;<\/span>\n\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">condition<\/span> <span class=\"hljs-attr\">property<\/span>=<span class=\"hljs-string\">\"required.files.missing\"<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">or<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">not<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">available<\/span> <span class=\"hljs-attr\">file<\/span>=<span class=\"hljs-string\">\"one.txt\"<\/span>\/&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">not<\/span>&gt;<\/span>\n        <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">not<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">available<\/span> <span class=\"hljs-attr\">file<\/span>=<span class=\"hljs-string\">\"two.txt\"<\/span>\/&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">not<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">or<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">condition<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">fail<\/span> <span class=\"hljs-attr\">if<\/span>=<span class=\"hljs-string\">\"required.files.missing\"<\/span> <span class=\"hljs-attr\">message<\/span>=<span class=\"hljs-string\">\"one.txt and two.txt must exist.\"<\/span>\/&gt;<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Version notes preserved from the original reference<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>zip<\/strong>: Unix permission storage in archive was noted from Ant 1.5.2.<\/li><li><strong>zip<\/strong>: roundup noted from Ant 1.6.2; comment from 1.6.3; level from 1.7.<\/li><li><strong>concat<\/strong>: resource collection behavior noted from Ant 1.7.1.<\/li><li><strong>fail<\/strong>: status attribute noted from Ant 1.6.2.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Common pitfalls and best practices<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Set <strong>zip duplicate<\/strong> to <strong>fail<\/strong> or <strong>preserve<\/strong> unless duplicate paths are intentional.<\/li><li>Use explicit <strong>encoding<\/strong> for zip and concat in mixed-platform teams.<\/li><li>Treat <strong>checksum property<\/strong> + <strong>verifyproperty<\/strong> carefully; semantics differ between generate and verify modes.<\/li><li>Use <strong>fail<\/strong> for guardrails (missing files, missing environment state) so bad builds stop early.<\/li><li>Keep regex replacements narrow (scoped filesets + tested patterns) to avoid mass accidental edits.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>A practical, updated reference for five widely used Apache Ant tasks: zip, concat, replaceregexp, checksum, and fail. Learn key attributes, safe defaults, and production-ready build.xml examples.<\/p>\n","protected":false},"author":1,"featured_media":4237,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[12],"tags":[209,3793,683,3785,3792,3790,3789,3791,3504,3783,3787,295,578,3788,3784,3786],"class_list":["post-230","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache-ant","tag-ant","tag-ant-task-complete-guide","tag-apache-ant","tag-apache-ant-task","tag-apache-ant-task-cheatsheet","tag-apache-ant-task-guide","tag-apache-ant-task-overview","tag-apache-ant-task-reference","tag-checksum","tag-complete-task-reference","tag-concat","tag-debugging","tag-fail","tag-replaceregexp","tag-task-reference","tag-zip"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/230","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=230"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/230\/revisions"}],"predecessor-version":[{"id":79060,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/230\/revisions\/79060"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/4237"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=230"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=230"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=230"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}