{"id":277,"date":"2010-07-22T11:06:46","date_gmt":"2010-07-22T11:06:46","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2010\/07\/22\/intellij-ant-integration\/"},"modified":"2021-06-23T03:58:07","modified_gmt":"2021-06-23T03:58:07","slug":"intellij-ant-integration","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/intellij-ant-integration\/","title":{"rendered":"How to run ant build in intellij? &#8211; IntelliJ\/Ant integration Guide"},"content":{"rendered":"<p><strong>IntelliJ\/Ant integration<\/strong><br \/>By Alvin J. Alexander, devdaily.com<br \/>The fact that IntelliJ is off-the-shelf ready to work with Ant is a great, great feature. It&#8217;s also simple to configure and use.<br \/>Assuming that you already know how to use Ant, and you have a build.xml file ready to go, just follow these steps to (a) configure your build script to run from within IntelliJ, and (b) run Ant:<\/p>\n<ul>\n<li>Assuming you&#8217;re in an IntelliJ project, select 6: Ant Build from the slide-in menu bar (&#8220;Tool Window Bar&#8221;) on the right side of your screen.<\/li>\n<li>Click the large plus sign icon to add your build.xml file to IntelliJ&#8217;s list of known build scripts for this project.<\/li>\n<li>Navigate the filesystem until you find your build script (i.e., your build.xml file for this project). Select that file.<\/li>\n<li>To run a desired Ant task, double-click the task name that you want to run. My main task is usually named deploy, so I double-click that.<\/li>\n<li>Ant should run properly for you, and deploy your application.<\/li>\n<\/ul>\n<p>It&#8217;s really that simple.<br \/>The worst problem I&#8217;ve run into so far is that when I work on projects on multiple computer systems, my build scripts rely on an environment parameter named ANT_HOST_NAME existing. So, when my build script failed the first time, I said &#8220;Oh, dummy Al, you need to set your ANT_HOST_NAME environment parameter. Once I did this and restarted IntelliJ, the Ant build process worked like a champ.<br \/>Kudos, dear IntelliJ developers. Great product feature!<\/p>\n<p>Best Example of &lt;Copy&gt;<\/p>\n<p>\u00a0<\/p>\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\">Type 1:\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">copy<\/span> <span class=\"hljs-attr\">todir<\/span>=<span class=\"hljs-string\">\"${Temp}\/uaw\/Uaw_compilescripts\"<\/span> <span class=\"hljs-attr\">overwrite<\/span>=<span class=\"hljs-string\">\"true\"<\/span> <span class=\"hljs-attr\">failonerror<\/span>=<span class=\"hljs-string\">\"false\"<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">fileset<\/span> <span class=\"hljs-attr\">dir<\/span>=<span class=\"hljs-string\">\"${SVNCheckout}\/scripts\/compilescripts\"<\/span> <span class=\"hljs-attr\">includes<\/span>=<span class=\"hljs-string\">\"BuildSh,Compsh,vsamc,buildc.sh,script,compl2,main.sh,makefile,makepl1,script\"<\/span> \/&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">copy<\/span>&gt;<\/span>\r\n\r\nType 2:\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">copy<\/span> <span class=\"hljs-attr\">todir<\/span>=<span class=\"hljs-string\">\"${Temp}\/uaw\/Uaw_compilescripts\"<\/span> <span class=\"hljs-attr\">overwrite<\/span>=<span class=\"hljs-string\">\"true\"<\/span> <span class=\"hljs-attr\">failonerror<\/span>=<span class=\"hljs-string\">\"false\"<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">fileset<\/span> <span class=\"hljs-attr\">dir<\/span>=<span class=\"hljs-string\">\"${SVNCheckout}\/scripts\/compilescripts\"<\/span> <span class=\"hljs-attr\">includes<\/span>=<span class=\"hljs-string\">\"BuildSh,Compsh,vsamc,buildc.sh,script,compl2,main.sh,makefile,makepl1,script\"<\/span> \/&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">copy<\/span>&gt;<\/span>\r\n\r\nType 3:\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">copy<\/span> <span class=\"hljs-attr\">todir<\/span>=<span class=\"hljs-string\">\"${Temp}\/uaw\/Uaw_compilescripts\"<\/span> <span class=\"hljs-attr\">overwrite<\/span>=<span class=\"hljs-string\">\"true\"<\/span> <span class=\"hljs-attr\">failonerror<\/span>=<span class=\"hljs-string\">\"false\"<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">fileset<\/span> <span class=\"hljs-attr\">dir<\/span>=<span class=\"hljs-string\">\"${SVNCheckout}\/scripts\/compilescripts\u201d&gt;\r\n&lt;include name=\"<\/span><span class=\"hljs-attr\">BuildSh<\/span>\"\/&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">include<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\">\"Compsh\"<\/span>\/&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">include<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\">\"vsamc\"<\/span>\/&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">fileset<\/span>&gt;<\/span>\r\n\r\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">copy<\/span>&gt;<\/span>\r\n\r\nType4:\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">copy<\/span> <span class=\"hljs-attr\">todir<\/span>=<span class=\"hljs-string\">\"${Temp}\/uaw\/Uaw_compilescripts\"<\/span> <span class=\"hljs-attr\">overwrite<\/span>=<span class=\"hljs-string\">\"true\"<\/span> <span class=\"hljs-attr\">failonerror<\/span>=<span class=\"hljs-string\">\"false\"<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">fileset<\/span> <span class=\"hljs-attr\">dir<\/span>=<span class=\"hljs-string\">\"${SVNCheckout}\/scripts\/compilescripts\"<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">includesfile<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\">\"${List}\/Uaw_compilescripts_list.txt\"<\/span>\/&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">fileset<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">copy<\/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><strong>Reference<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/lightrun.com\/debugging\/how-to-debug-remotely-in-intellij\/\" data-type=\"URL\" data-id=\"https:\/\/lightrun.com\/debugging\/how-to-debug-remotely-in-intellij\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Debug Remotely With IntelliJ<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>IntelliJ\/Ant integrationBy Alvin J. Alexander, devdaily.comThe fact that IntelliJ is off-the-shelf ready to work with Ant is a great, great feature. It&#8217;s also simple to configure and use.Assuming that you already know how to use Ant, and you have a build.xml file ready to go, just follow these steps to (a) configure your build script&#8230;<\/p>\n","protected":false},"author":1,"featured_media":4412,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[12],"tags":[209,3827,4234,4233,1122,4229,588,4231,4230,4232,213],"class_list":["post-277","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apache-ant","tag-ant","tag-ant-build","tag-ant-integration-in-intellij","tag-configure-intellij-using-ant","tag-guide","tag-how-to-run-ant-build-in-intellij","tag-integration","tag-intellij","tag-intellij-configure-ant","tag-intellij-ant-integration","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/277","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=277"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/277\/revisions"}],"predecessor-version":[{"id":21880,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/277\/revisions\/21880"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/4412"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}