{"id":1921,"date":"2017-12-06T11:39:11","date_gmt":"2017-12-06T11:39:11","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=1921"},"modified":"2021-02-27T09:30:35","modified_gmt":"2021-02-27T09:30:35","slug":"apache-ant-copy-task-full-reference","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-copy-task-full-reference\/","title":{"rendered":"Apache Ant: Copy Task full reference"},"content":{"rendered":"<p><strong>rajeshkumar created the topic: Apache Ant: Copy Task full reference<\/strong><br \/>\n<b>This copies all files in directories called images that are located in the directory tree defined by ${src} to the destination directory defined by ${dist}, but excludes all *.gif files from the copy.<\/b><\/p>\n<p><code><copy todir=\"${dist}\"><br \/>\n<fileset dir=\"${src}\"\nincludes=\"**\/images\/*\"\nexcludes=\"**\/*.gif\"\n\/><br \/>\n<\/copy><\/p>\n<p><b>The same as the example above, but expressed using nested elements.<\/b><\/p>\n<p><copy todir=\"${dist}\"><br \/>\n<fileset dir=\"${src}\"><br \/>\n<include name=\"**\/images\/*\"\/><br \/>\n<exclude name=\"**\/*.gif\"\/><br \/>\n<\/fileset><br \/>\n<\/copy><\/p>\n<p><b>Copy a single file<\/b><br \/>\n<copy file=\"myfile.txt\" tofile=\"mycopy.txt\"\/><\/p>\n<p><b>Copy a single file to a directory<\/b><\/p>\n<p><copy file=\"myfile.txt\" todir=\"..\/some\/other\/dir\"\/><\/p>\n<p><b>Copy a directory to another directory<\/b><\/p>\n<p><copy todir=\"..\/new\/dir\"><br \/>\n<fileset dir=\"src_dir\"\/><br \/>\n<\/copy><\/p>\n<p><b>Copy a set of files to a directory<\/b><\/p>\n<p><copy todir=\"..\/dest\/dir\"><br \/>\n<fileset dir=\"src_dir\"><br \/>\n<exclude name=\"**\/*.java\"\/><br \/>\n<\/fileset><br \/>\n<\/copy><\/p>\n<p><copy todir=\"..\/dest\/dir\"><br \/>\n<fileset dir=\"src_dir\" excludes=\"**\/*.java\"\/><br \/>\n<\/copy><\/p>\n<p><b>Copy a set of files to a directory, replacing @TITLE@ with Foo Bar in all files.<\/b><\/p>\n<p><copy todir=\"..\/backup\/dir\"><br \/>\n<fileset dir=\"src_dir\"\/><br \/>\n<filterset><br \/>\n<filter token=\"TITLE\" value=\"Foo Bar\"\/><br \/>\n<\/filterset><br \/>\n<\/copy><\/p>\n<p><b>Collect all items from the current CLASSPATH setting into a destination directory, flattening the directory structure.<\/b><br \/>\n<copy todir=\"dest\" flatten=\"true\">\n    <path>\n      <pathelement path=\"${java.class.path}\"\/>\n    <\/path>\n  <\/copy><\/p>\n<p><b>Copies some resources to a given directory.<\/b><br \/>\n<copy todir=\"dest\" flatten=\"true\"><br \/>\n    <resources><br \/>\n      <file file=\"src_dir\/file1.txt\"\/><br \/>\n      <url url=\"http:\/\/ant.apache.org\/index.html\"\/><br \/>\n    <\/resources><br \/>\n  <\/copy><\/p>\n<p><b>Copies the two newest resources into a destination directory.<\/b><br \/>\n<copy todir=\"dest\" flatten=\"true\"><br \/>\n    <first count=\"2\"><br \/>\n      <sort><br \/>\n        <date xmlns=\"antlib:org.apache.tools.ant.types.resources.comparators\"\/><br \/>\n        <resources><br \/>\n          <file file=\"src_dir\/file1.txt\"\/><br \/>\n          <file file=\"src_dir\/file2.txt\"\/><br \/>\n          <file file=\"src_dir\/file3.txt\"\/><br \/>\n          <url url=\"http:\/\/ant.apache.org\/index.html\"\/><br \/>\n        <\/resources><br \/>\n      <\/sort><br \/>\n    <\/first><br \/>\n  <\/copy><\/p>\n<p><b>copy a set of files<\/b><br \/>\n<copy todir=\"${temp.dir.classes}\"><br \/>\n  <fileset dir=\"${src.dir}\"><br \/>\n    <include name=\"**\/*.xml\"\/><br \/>\n    <include name=\"**\/*.xsl\"\/><br \/>\n    <include name=\"**\/*.properties\"\/><br \/>\n  <\/fileset><br \/>\n<\/copy><\/p>\n<p><b>Ant copy task examples<\/b><br \/>\n<copy file=\"${resources.dir}\/MANIFEST.MF\" tofile=\"${temp.dir.meta-inf}\/MANIFEST.MF\" overwrite=\"true\" \/><br \/>\n<copy file=\"${resources.dir}\/managed-beans.xml\" tofile=\"${temp.dir.web-inf}\/managed-beans.xml\" overwrite=\"true\" \/><br \/>\n<copy file=\"${resources.dir}\/navigation-rules.xml\" tofile=\"${temp.dir.web-inf}\/navigation-rules.xml\" overwrite=\"true\" \/><br \/>\n<copy file=\"${resources.dir}\/monitoring-managed-beans.xml\" tofile=\"${temp.dir.web-inf}\/monitoring-managed-beans.xml\" overwrite=\"true\" \/><br \/>\n<copy file=\"${resources.dir}\/monitoring-navigation-rules.xml\" tofile=\"${temp.dir.web-inf}\/monitoring-navigation-rules.xml\" overwrite=\"true\" \/><br \/>\n<copy file=\"${resources.dir}\/faces-config.xml\" tofile=\"${temp.dir.web-inf}\/faces-config.xml\" overwrite=\"true\" \/><br \/>\n<copy file=\"${resources.dir}\/log4j.properties\" tofile=\"${temp.dir.classes}\/log4j.properties\" overwrite=\"true\" \/><br \/>\n<copy file=\"${resources.dir}\/commons-logging.properties\" tofile=\"${temp.dir.classes}\/commons-logging.properties\" overwrite=\"true\" \/><br \/>\nfileset dir=\"${config.deploy.dir}\"><br \/>\n            <include name=\"**\"\/><br \/>\n            <exclude name=\"apps\/\"\/><br \/>\n           <\/fileset><\/code><br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\">twitter.com\/RajeshKumarIn<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>rajeshkumar created the topic: Apache Ant: Copy Task full reference This copies all files in directories called images that are [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[1],"tags":[420],"class_list":["post-1921","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-apache"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Apache Ant: Copy Task full reference - scmGalaxy<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-copy-task-full-reference\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apache Ant: Copy Task full reference - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"rajeshkumar created the topic: Apache Ant: Copy Task full reference This copies all files in directories called images that are [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-copy-task-full-reference\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-06T11:39:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-27T09:30:35+00:00\" \/>\n<meta name=\"author\" content=\"scmgalaxy K\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"scmgalaxy K\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-copy-task-full-reference\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-copy-task-full-reference\\\/\"},\"author\":{\"name\":\"scmgalaxy K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"headline\":\"Apache Ant: Copy Task full reference\",\"datePublished\":\"2017-12-06T11:39:11+00:00\",\"dateModified\":\"2021-02-27T09:30:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-copy-task-full-reference\\\/\"},\"wordCount\":57,\"commentCount\":0,\"keywords\":[\"Apache\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-copy-task-full-reference\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-copy-task-full-reference\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-copy-task-full-reference\\\/\",\"name\":\"Apache Ant: Copy Task full reference - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"datePublished\":\"2017-12-06T11:39:11+00:00\",\"dateModified\":\"2021-02-27T09:30:35+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-copy-task-full-reference\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-copy-task-full-reference\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-copy-task-full-reference\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Apache Ant: Copy Task full reference\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\",\"name\":\"scmGalaxy\",\"description\":\"A Platform for Software Engineers\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\",\"name\":\"scmgalaxy K\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g\",\"caption\":\"scmgalaxy K\"},\"sameAs\":[\"http:\\\/\\\/www.DevOpsSchool.com\"],\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/author\\\/scmgalaxy\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apache Ant: Copy Task full reference - scmGalaxy","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-copy-task-full-reference\/","og_locale":"en_US","og_type":"article","og_title":"Apache Ant: Copy Task full reference - scmGalaxy","og_description":"rajeshkumar created the topic: Apache Ant: Copy Task full reference This copies all files in directories called images that are [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-copy-task-full-reference\/","og_site_name":"scmGalaxy","article_published_time":"2017-12-06T11:39:11+00:00","article_modified_time":"2021-02-27T09:30:35+00:00","author":"scmgalaxy K","twitter_card":"summary_large_image","twitter_misc":{"Written by":"scmgalaxy K","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-copy-task-full-reference\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-copy-task-full-reference\/"},"author":{"name":"scmgalaxy K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"headline":"Apache Ant: Copy Task full reference","datePublished":"2017-12-06T11:39:11+00:00","dateModified":"2021-02-27T09:30:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-copy-task-full-reference\/"},"wordCount":57,"commentCount":0,"keywords":["Apache"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-copy-task-full-reference\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-copy-task-full-reference\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-copy-task-full-reference\/","name":"Apache Ant: Copy Task full reference - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"datePublished":"2017-12-06T11:39:11+00:00","dateModified":"2021-02-27T09:30:35+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-copy-task-full-reference\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-copy-task-full-reference\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-copy-task-full-reference\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Apache Ant: Copy Task full reference"}]},{"@type":"WebSite","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website","url":"https:\/\/www.scmgalaxy.com\/tutorials\/","name":"scmGalaxy","description":"A Platform for Software Engineers","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.scmgalaxy.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102","name":"scmgalaxy K","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4b902ea8c77ee0a326c112f29d0edf51b7c3e1cd05c4fb92a810177e9c3f12a9?s=96&d=mm&r=g","caption":"scmgalaxy K"},"sameAs":["http:\/\/www.DevOpsSchool.com"],"url":"https:\/\/www.scmgalaxy.com\/tutorials\/author\/scmgalaxy\/"}]}},"_links":{"self":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/1921","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/comments?post=1921"}],"version-history":[{"count":2,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/1921\/revisions"}],"predecessor-version":[{"id":1923,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/1921\/revisions\/1923"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=1921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=1921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=1921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}