{"id":1000081,"date":"2006-07-07T09:29:41","date_gmt":"2006-07-07T14:29:41","guid":{"rendered":"http:\/\/www.elharo.com\/blog\/software-development\/2006\/07\/07\/copying-files-from-one-jar-to-another-using-ant\/"},"modified":"2006-07-08T04:18:36","modified_gmt":"2006-07-08T09:18:36","slug":"copying-files-from-one-jar-to-another-using-ant","status":"publish","type":"post","link":"https:\/\/www.elharo.com\/blog\/software-development\/java\/2006\/07\/07\/copying-files-from-one-jar-to-another-using-ant\/","title":{"rendered":"Copying files from one JAR to another using ANT"},"content":{"rendered":"<p>To avoid needless duplication of source files in two different repositories, I would like to write an Ant build.xml file that copies files from one .jar file to another. I don&#8217;t want to copy everything in the source jar, just certain selected files.<br \/>\n<!--more--><\/p>\n<p>Now I could certainly use the unjar task to extract everything from the jar into a temporary directory, then use a <code>copy<\/code> task to copy the files to the directory from which the new jar will be built, then use a delete task to remove the temporary directory. However is there anything simpler?<\/p>\n<p>In particular, is there a way to treat a jar (or, for that matter, a zip or a tar) as a directory tree from which files can be copied without making temporary copies first? For instance, could I set the <code>src<\/code> attribute of the <code>copydir <\/code> element to a jar file instead of an actual directory? <\/p>\n","protected":false},"excerpt":{"rendered":"<p>To avoid needless duplication of source files in two different repositories, I would like to write an Ant build.xml file that copies files from one .jar file to another. I don&#8217;t want to copy everything in the source jar, just certain selected files.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[410],"class_list":["post-1000081","post","type-post","status-publish","format-standard","hentry","category-java","tag-flash"],"_links":{"self":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/1000081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/comments?post=1000081"}],"version-history":[{"count":0,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/1000081\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/media?parent=1000081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/categories?post=1000081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/tags?post=1000081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}