{"id":1896,"date":"2017-12-06T10:27:24","date_gmt":"2017-12-06T10:27:24","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=1896"},"modified":"2021-02-27T09:30:36","modified_gmt":"2021-02-27T09:30:36","slug":"apache-ant-interview-questions","status":"publish","type":"post","link":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-interview-questions\/","title":{"rendered":"Apache ant interview questions"},"content":{"rendered":"<p><strong>rajeshkumar created the topic: Apache ant interview questions<\/strong><br \/>\nLinks to all Apache Ant Task &#8211;<a href=\"http:\/\/ant.apache.org\/manual\/tasklist.html\"> ant.apache.org\/manual\/tasklist.html <\/a><\/p>\n<p>Question 1. Write a ant build.xml and call one batch file from build.xml. batch file should create one directory.<\/p>\n<p>Question 2. Write a ant build.xml which should copy the files and folders from another and create a tar file.<\/p>\n<p>Question 3. Linux &#8211; Write a ant build.xml which should create 5 files and five folders and change the file permission to all files to 644 and folder to 755.<\/p>\n<p>Question 4. Write a two build.xml named with &#8220;build1.xml&#8221; and &#8220;build2.xml&#8221;. Each build.xml will compile one java program but build2.xml should be called from build1.xml.<\/p>\n<p>Question 5. Go through all these questions mentioned in the url below and try to find an answer and provide your answer as part of comments.<br \/>\nwww.scmgalaxy.com\/index.php?option=com_k&#8230;d-answers&#038;Itemid=120<br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\">twitter.com\/RajeshKumarIn<\/a><\/p>\n<p><strong>sribhavani_u replied the topic: Apache ant interview questions<\/strong><br \/>\nQuestion1<br \/>\n========\n<project name=\"createdir\" basedir=\".\" default=\"batch\">\n<target name=\"batch\"><br \/>\n<exec dir=\".\" executable=\"cmd\"><br \/>\n<arg line =\"\/c createdir.bat\" \/><br \/>\n<\/exec><br \/>\n<\/target>\n<\/project>\n<p>Question2<br \/>\n=========\n<project name=\"copyfiles\" basedir=\".\" default=\"tar\">\n<property name=\"src.dir\" value=\"src\"\/>\n<property name=\"build.dir\" value=\"build\"\/>\n<target name=\"copy\"><br \/>\n<copy todir=\"${build.dir}\"><br \/>\n<fileset dir=\"${src.dir}\"><br \/>\n<\/fileset><br \/>\n<\/copy><br \/>\n<\/target><br \/>\n<target name=\"tar\" depends=\"copy\"><br \/>\n<tar destfile=\"C:\\SRI PROJECTS\\apache-ant-1.9.0\\testwork\/tarfile.tar\" basedir=\"${build.dir}\"\/><br \/>\n<\/target>\n<\/project>\n<p>Question 3<br \/>\n=========\n<project name=\"setperm\" basedir=\".\" default=\"changeperm\">\n<target name=\"createfile\"><br \/>\n<touch file=\"file1\"\/><br \/>\n<touch file=\"file2\"\/><br \/>\n<touch file=\"file3\"\/><br \/>\n<touch file=\"file4\"\/><br \/>\n<touch file=\"file5\"\/><br \/>\n<echo>files created<\/echo><br \/>\n<\/target><br \/>\n<target name=\"createfolder\"><br \/>\n<mkdir dir=\"folder1\"\/><br \/>\n<mkdir dir=\"folder2\"\/><br \/>\n<mkdir dir=\"folder3\"\/><br \/>\n<mkdir dir=\"folder4\"\/><br \/>\n<mkdir dir=\"folder5\"\/><br \/>\n<echo>Folders created<\/echo><br \/>\n<\/target><br \/>\n<target name=\"changeperm\" depends=\"createfolder,createfile\"><br \/>\n<chmod perm=\"644\" type=\"file\"><br \/>\n<fileset dir=\"\/home\/sri\/antwork\"><br \/>\n<exclude name=\"**\/*.xml\"\/><br \/>\n<\/fileset><br \/>\n<\/chmod><br \/>\n<chmod perm=\"755\" type=\"dir\"><br \/>\n<dirset dir=\"\/home\/sri\/antwork\"\/><br \/>\n<\/chmod><br \/>\n<echo>permissions changed files:644 folders:755<\/echo><br \/>\n<\/target>\n<\/project>\n<p>Question4<br \/>\n=========<br \/>\nq4build1\n<project name=\"build1\" basedir=\".\" default=\"callbuild\">\n<target name=\"clean\"><br \/>\n<delete dir=\"build\"\/><br \/>\n<\/target><br \/>\n<target name=\"compile\" depends=\"clean\"><br \/>\n<mkdir dir=\"build\"\/><br \/>\n<javac srcdir=\".\" destdir=\"build\"><br \/>\n<include name=\"HelloWorld.java\"\/><br \/>\n<\/javac><br \/>\n<\/target><br \/>\n<target name=\"callbuild\" depends=\"compile\"><br \/>\n<ant antfile=\"build2.xml\" inheritrefs=\"false\"\/><br \/>\n<\/target>\n<\/project>\n<p>q4build2\n<project name=\"build2\" basedir=\".\" default=\"compile\">\n<target name=\"compile\" ><br \/>\n<javac srcdir=\".\" destdir=\"build\"><br \/>\n<include name=\"HelloWorld2.java\"\/><br \/>\n<\/javac><br \/>\n<\/target>\n<\/project>\n<p><strong>nineetha replied the topic: Apache ant interview questions<\/strong><br \/>\nQUESTION 1\n<project name=\"dir\" basedir=\".\" default=\"\">\n<target name=\"creatingbatch\"><br \/>\n<exec dir=\"D:\\Projects\\bin\" executable=\"cmd\"><br \/>\n<arg line =\"\/c md.bat\" \/><br \/>\n<\/exec><br \/>\n<\/target>\n<\/project>[\/b]<\/p>\n<p>QUESTION 2\n<project name=\"copyfiles\" basedir=\".\" default=\"createtar\">\n<property name=\"src.dir\" value=\"src\"\/>\n<property name=\"bin.dir\" value=\"bin\"\/>\n<p><target name=\"copy\"><br \/>\n<copy todir=\"${src.dir}\"><br \/>\n<fileset dir=${bin.dir}\"><br \/>\n<\/fileset><br \/>\n<\/copy><br \/>\n<\/target><br \/>\n<target name=\"create tar\" depends=\"copy\"><br \/>\n<tar destfile=\"D:\\Projects\\build.tar\" basedir=\"D:\\Projects\\src\"\/><br \/>\n<\/target>\n<\/project>\n<p>QUESTSION 3\n<project name=\"permissions\" basedir=\".\" default=\"chmod\">\n<target name=\"create file\"><br \/>\n<touch file=\"file1\"\/><br \/>\n<touch file=\"file2\"\/><br \/>\n<touch file=\"file3\"\/><br \/>\n<touch file=\"file4\"\/><br \/>\n<touch file=\"file5\"\/><br \/>\n<\/target><br \/>\n<target name=\"create folders\"><br \/>\n<mkdir dir=\"dir1\"\/><br \/>\n<mkdir dir=\"dir2\"\/><br \/>\n<mkdir dir=\"dir3\"\/><br \/>\n<mkdir dir=\"dir4\"\/><br \/>\n<mkdir dir=\"dir5\"\/><br \/>\n<\/target><br \/>\n<target name=\"chmod\" depends=\"create file,create folders\"><br \/>\n<exec executable=\"chmod\" type=\"file\"><br \/>\n<arg value=\"644\"\/><br \/>\n<arg value=\"D:\\Projects\"><br \/>\n<\/exec><br \/>\n<target name=\"chmod_files\" depends=\"create folders\"><br \/>\n<exec executable=\"chmod\" type=\"dir\"><br \/>\n<arg value=\"755\"\/><br \/>\n<arg value=\"D:\\Projects\"><br \/>\n<\/exec><br \/>\n<\/target>\n<\/project>\n<p>QUESTION 4\n<project name=\"call\" basedir=\".\" default=\"subant1\">\ntarget<name=\"subant1\" ><br \/>\n<subant target=\"subant2\"><br \/>\n<fileset dir=\".\" includes=\"helloworld\/build.xml\"\/>&#8221;<br \/>\n<javac srcdir=\"${src}\" destdir=\"{bin}\"><br \/>\n<\/subant><br \/>\n<\/target>\n<\/project>\n<project name=\"call2\" basedir=\".\">\n<target name=\"subant2\"><br \/>\n<subant taget=\"subant2\"><br \/>\n<javac srcdir=\"{src}\" destdir=\"{bin}\"><br \/>\n<fileset dir=\".\" includes=\"*\/build.xml\"\/><br \/>\n<fileset dir=\".\" includes=\"welcome\/build.xml\"\/><br \/>\n<\/subant>\n<\/project>\n<p><strong>rajeshkumar replied the topic: Apache ant interview questions<\/strong><br \/>\nGood work. I checked last week and its nice.<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 interview questions Links to all Apache Ant Task &#8211; ant.apache.org\/manual\/tasklist.html Question 1. Write a [&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":[419],"tags":[420],"class_list":["post-1896","post","type-post","status-publish","format-standard","hentry","category-apache-ant-build-management-tools","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 interview questions - 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-interview-questions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apache ant interview questions - scmGalaxy\" \/>\n<meta property=\"og:description\" content=\"rajeshkumar created the topic: Apache ant interview questions Links to all Apache Ant Task &#8211; ant.apache.org\/manual\/tasklist.html Question 1. Write a [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-interview-questions\/\" \/>\n<meta property=\"og:site_name\" content=\"scmGalaxy\" \/>\n<meta property=\"article:published_time\" content=\"2017-12-06T10:27:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-02-27T09:30:36+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-interview-questions\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-interview-questions\\\/\"},\"author\":{\"name\":\"scmgalaxy K\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"headline\":\"Apache ant interview questions\",\"datePublished\":\"2017-12-06T10:27:24+00:00\",\"dateModified\":\"2021-02-27T09:30:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-interview-questions\\\/\"},\"wordCount\":201,\"commentCount\":0,\"keywords\":[\"Apache\"],\"articleSection\":[\"Apache Ant\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-interview-questions\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-interview-questions\\\/\",\"url\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-interview-questions\\\/\",\"name\":\"Apache ant interview questions - scmGalaxy\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#website\"},\"datePublished\":\"2017-12-06T10:27:24+00:00\",\"dateModified\":\"2021-02-27T09:30:36+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/fc12ad190f540e79460243c81148d102\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-interview-questions\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-interview-questions\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/apache-ant-interview-questions\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.scmgalaxy.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Apache ant interview questions\"}]},{\"@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 interview questions - 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-interview-questions\/","og_locale":"en_US","og_type":"article","og_title":"Apache ant interview questions - scmGalaxy","og_description":"rajeshkumar created the topic: Apache ant interview questions Links to all Apache Ant Task &#8211; ant.apache.org\/manual\/tasklist.html Question 1. Write a [&hellip;]","og_url":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-interview-questions\/","og_site_name":"scmGalaxy","article_published_time":"2017-12-06T10:27:24+00:00","article_modified_time":"2021-02-27T09:30:36+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-interview-questions\/#article","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-interview-questions\/"},"author":{"name":"scmgalaxy K","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"headline":"Apache ant interview questions","datePublished":"2017-12-06T10:27:24+00:00","dateModified":"2021-02-27T09:30:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-interview-questions\/"},"wordCount":201,"commentCount":0,"keywords":["Apache"],"articleSection":["Apache Ant"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-interview-questions\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-interview-questions\/","url":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-interview-questions\/","name":"Apache ant interview questions - scmGalaxy","isPartOf":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#website"},"datePublished":"2017-12-06T10:27:24+00:00","dateModified":"2021-02-27T09:30:36+00:00","author":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/#\/schema\/person\/fc12ad190f540e79460243c81148d102"},"breadcrumb":{"@id":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-interview-questions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-interview-questions\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.scmgalaxy.com\/tutorials\/apache-ant-interview-questions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.scmgalaxy.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Apache ant interview questions"}]},{"@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\/1896","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=1896"}],"version-history":[{"count":1,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/1896\/revisions"}],"predecessor-version":[{"id":1897,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/posts\/1896\/revisions\/1897"}],"wp:attachment":[{"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/media?parent=1896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/categories?post=1896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scmgalaxy.com\/tutorials\/wp-json\/wp\/v2\/tags?post=1896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}