{"id":1637,"date":"2016-12-14T10:41:29","date_gmt":"2016-12-14T10:41:29","guid":{"rendered":"http:\/\/cloudkul.com\/blog\/?p=1637"},"modified":"2017-06-14T11:33:36","modified_gmt":"2017-06-14T11:33:36","slug":"apache-ant-integration-jenkins","status":"publish","type":"post","link":"https:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/","title":{"rendered":"Apache Ant Integration with Jenkins"},"content":{"rendered":"<p>Apache Ant is a java based build tool. ANT stands for Another Neat Tool. Main purpose of Ant is to build java based applications. we can run many built-in tasks like compile,assemble and test. We define the tasks in a <strong>build.xml<\/strong> file. Ant reads the <strong>xml<\/strong> file and executes the task accordingly. We can also execute shell commands through Ant.<\/p>\n<p>In this tutorial, I will show you how to integrate ant with Jenkins.<\/p>\n<p>I have already setup Jenkins in the server. Now, it is time to install Ant. You can install ant manually and integrate it with Jenkins or you can download and install Jenkins through Jenkins. I am downloading Ant manually and integrating it with Jenkins later.<\/p>\n<p><span style=\"text-decoration: underline\"><strong>Download and Setup Ant<\/strong><\/span><\/p>\n<pre class=\"lang:sh decode:true\">sudo su\r\napt-get install zip\r\n# Download apache ant\r\nwget http:\/\/www-us.apache.org\/dist\/\/ant\/binaries\/apache-ant-1.9.7-bin.zip\r\nunzip apache-ant-1.9.7-bin.zip\r\nmv apache-ant-1.9.7-bin.zip \/opt\/ant\r\n<\/pre>\n<p>my Ant directory is <strong>\/opt\/ant<\/strong> and Ant executable is located at <strong>\/opt\/ant\/bin<\/strong>. I need to add some lines in <strong>.bashrc<\/strong> file.<\/p>\n<p>Open your <strong>.bashrc<\/strong> file and add the following lines.<\/p>\n<pre class=\"lang:sh decode:true \">export ANT_HOME=\/opt\/ant\r\nexport PATH=$PATH:$ANT_HOME\/bin\/<\/pre>\n<p>Now, logout and again login to your root shell to use the exported variables.<\/p>\n<p>Now, Ant is setup in the server. We need to integrate with Jenkins.<\/p>\n<p><span style=\"text-decoration: underline\"><strong>Setup Ant in Jenkins<\/strong><\/span><\/p>\n<p>Login to your admin panel in Jenkins. Go to <strong>Manage Jenkins<\/strong> -&gt; <strong>Global Tool Configuration<\/strong><\/p>\n<p>In Global Tool Configuration select <strong>Add Ant<\/strong>. I have already installed Ant. So I just need to provide <strong>Name<\/strong> and <strong>ANT_HOME<\/strong>. My \u00a0ANT_HOME is \/opt\/ant.<\/p>\n<p>If you have not Installed Ant, then you can install Ant here. Just select install automatically and choose the appropriate <strong>Add Installer<\/strong> option whether you want to extract from zip or install from Apache.<\/p>\n<p><a href=\"http:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2016\/12\/ant-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1643\" src=\"http:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2016\/12\/ant-2.png\" alt=\"ant-2\" width=\"968\" height=\"626\" \/><\/a><\/p>\n<p>Now, Ant is integrated with Jenkins. You can use Ant in the build process. While configuring a job, in the build option select <strong>invoke Ant\u00a0<\/strong>and choose the Ant version. In my case, I have given the name ant so there are two options available <strong>default<\/strong> and <strong>ant<\/strong>. Select advance option and you can configure extra parameters. I have chosen the build file <strong>build.xml<\/strong>. So when ever Ant is executed it will read from <strong>build.xml<\/strong> file.<\/p>\n<p><a href=\"http:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2016\/12\/ant-build.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1644\" src=\"http:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2016\/12\/ant-build.png\" alt=\"ant-build\" width=\"998\" height=\"620\" \/><\/a><\/p>\n<p>You can put your <strong>build.xml<\/strong> file along with git repository. So whenever you want to test some code you can read from the <strong>build.xml<\/strong> file and define different <strong>build.xml<\/strong> file for different repository. This is all about setting up Ant with Jenkins. If you have any doubts regarding configuration, you can ask me in the comment.<\/p>\n<p style=\"text-align: center\">\u00a0<a href=\"http:\/\/cloudkul.com\/contact\/\" target=\"_blank\">IN CASE OF ANY QUERY,CONTACT US<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apache Ant is a java based build tool. ANT stands for Another Neat Tool. Main <a class=\"text-primary\" title=\"read more\" href=\"https:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":8,"featured_media":1647,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[94],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Apache Ant Integration with Jenkins - Cloudkul<\/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:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apache Ant Integration with Jenkins - Cloudkul\" \/>\n<meta property=\"og:description\" content=\"Apache Ant is a java based build tool. ANT stands for Another Neat Tool. Main [...]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudkul\" \/>\n<meta property=\"article:published_time\" content=\"2016-12-14T10:41:29+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-06-14T11:33:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2016\/12\/download.png\" \/>\n\t<meta property=\"og:image:width\" content=\"848\" \/>\n\t<meta property=\"og:image:height\" content=\"422\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"suranjan horrow\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/\",\"url\":\"https:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/\",\"name\":\"Apache Ant Integration with Jenkins - Cloudkul\",\"isPartOf\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\"},\"datePublished\":\"2016-12-14T10:41:29+00:00\",\"dateModified\":\"2017-06-14T11:33:36+00:00\",\"author\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/a653191c790a89b07d4b4aaefc3e2809\"},\"breadcrumb\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Apache Ant Integration with Jenkins\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\",\"url\":\"https:\/\/cloudkul.com\/blog\/\",\"name\":\"Cloudkul\",\"description\":\"Host your eCommerce Store on AWS with Optimized Performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudkul.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/a653191c790a89b07d4b4aaefc3e2809\",\"name\":\"suranjan horrow\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/dfd7f87bc7d62c1426e1f4c07653ff00?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/dfd7f87bc7d62c1426e1f4c07653ff00?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"caption\":\"suranjan horrow\"},\"sameAs\":[\"http:\/\/webkul.com\"],\"url\":\"https:\/\/cloudkul.com\/blog\/author\/suranjan-horrow869\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apache Ant Integration with Jenkins - Cloudkul","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:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/","og_locale":"en_US","og_type":"article","og_title":"Apache Ant Integration with Jenkins - Cloudkul","og_description":"Apache Ant is a java based build tool. ANT stands for Another Neat Tool. Main [...]","og_url":"https:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/","og_site_name":"Cloudkul","article_published_time":"2016-12-14T10:41:29+00:00","article_modified_time":"2017-06-14T11:33:36+00:00","og_image":[{"width":848,"height":422,"url":"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2016\/12\/download.png","type":"image\/png"}],"author":"suranjan horrow","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/","url":"https:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/","name":"Apache Ant Integration with Jenkins - Cloudkul","isPartOf":{"@id":"https:\/\/cloudkul.com\/blog\/#website"},"datePublished":"2016-12-14T10:41:29+00:00","dateModified":"2017-06-14T11:33:36+00:00","author":{"@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/a653191c790a89b07d4b4aaefc3e2809"},"breadcrumb":{"@id":"https:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cloudkul.com\/blog\/apache-ant-integration-jenkins\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Apache Ant Integration with Jenkins"}]},{"@type":"WebSite","@id":"https:\/\/cloudkul.com\/blog\/#website","url":"https:\/\/cloudkul.com\/blog\/","name":"Cloudkul","description":"Host your eCommerce Store on AWS with Optimized Performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudkul.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/a653191c790a89b07d4b4aaefc3e2809","name":"suranjan horrow","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/dfd7f87bc7d62c1426e1f4c07653ff00?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dfd7f87bc7d62c1426e1f4c07653ff00?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","caption":"suranjan horrow"},"sameAs":["http:\/\/webkul.com"],"url":"https:\/\/cloudkul.com\/blog\/author\/suranjan-horrow869\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/1637"}],"collection":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/comments?post=1637"}],"version-history":[{"count":7,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/1637\/revisions"}],"predecessor-version":[{"id":1649,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/1637\/revisions\/1649"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media\/1647"}],"wp:attachment":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media?parent=1637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/categories?post=1637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/tags?post=1637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}