{"id":48999,"date":"2017-08-09T11:00:07","date_gmt":"2017-08-09T08:00:07","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=48999"},"modified":"2021-05-17T14:34:09","modified_gmt":"2021-05-17T11:34:09","slug":"apache-ant-tutorial-beginners","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/","title":{"rendered":"Apache Ant Tutorial for Beginners"},"content":{"rendered":"<p>This tutorial explains why Java Apache Ant was created and its advantages over other build tools. It also covers the installation of Ant and what goes into a java ant project.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-1-apache-ant-tutorial-introduction\"><a name=\"introduction\"><\/a>1. Apache Ant Tutorial &#8211; Introduction<\/h2>\n<p>In this tutorial, a sample project is set up. The Ant build file, for the sample project, is explored along with a discussion of how it is used to build the project. The tutorial ends with a link to download the entire project including source code, data file, and Ant build file.<\/p>\n<div class=\"toc\">\n<h3>Table Of Contents<\/h3>\n<dl>\n<dt><a href=\"#introduction\">1. Apache Ant Tutorial &#8211; Introduction<\/a><\/dt>\n<dt><a href=\"#overview\">2. Overview<\/a><\/dt>\n<dt><a href=\"#installation\">3. Installation<\/a><\/dt>\n<\/dl>\n<dl>\n<dt><a href=\"#ubuntu\">3.1. Ubuntu<\/a><\/dt>\n<dt><a href=\"#windows\">3.2. Windows<\/a><\/dt>\n<dt><a href=\"#test_install\">3.3. Testing the Installation<\/a><\/dt>\n<\/dl>\n<p><a href=\"#anatomy_ant_project\">4. Anatomy of an Ant Project<\/a><\/p>\n<dl>\n<dt><a href=\"#xml_decl\">4.1. XML Declaration<\/a><\/dt>\n<dt><a href=\"#proj_tag\">4.2. Project Tag<\/a><\/dt>\n<dt><a href=\"#tasks\">4.3. Tasks<\/a><\/dt>\n<dt><a href=\"#properties\">4.4. Properties<\/a><\/dt>\n<dt><a href=\"#targets\">4.5. Targets<\/a><\/dt>\n<dt><a href=\"#ext_points\">4.6. Extension-Points<\/a><\/dt>\n<\/dl>\n<dt><a href=\"#sample_proj\">5. Sample Project<\/a><\/dt>\n<dt><a href=\"#sample_proj\">5.1 Using Ant with Eclipse<\/a><\/dt>\n<p><a href=\"#more_info\">6. For More Information<\/a><\/p>\n<p><a href=\"#proj_download\">7. Project Download<\/a><\/p>\n<\/div>\n<div class=\"tip\"><strong>Tip<\/strong><br \/>You may skip the introductory part and jump directly to the <a href=\"#anatomy_ant_project\"><strong>Tutorial<\/strong><\/a> below.<\/div>\n<h2 class=\"wp-block-heading\" id=\"h-2-overview\"><a name=\"overview\"><\/a>2. Overview<\/h2>\n<p>Java Ant (\u201cAnother Neat Tool\u201d) is a popular build tool developed in Java and is included with most modern IDEs such as IntelliJ IDEA, Eclipse, and NetBeans. It was originally part of the Apache Tomcat code base and was released as a standalone product in July 2000. <\/p>\n<p>The principal use for Ant is for automation on building packages and artifacts for Java projects. Another big advantage of Ant is his portability. Just as it was built in Java, it is easily usable in several OS&#8217;s unlike other build tools such as make, gnumake, and jam are shell based tools. <\/p>\n<p>Once the dependencies are determined, each task is completed by issuing shell commands, which are limited to the particular OS where the project is being built. Ant avoids this limitation by using Java objects to execute tasks. However, if you need or want to use a shell command, Ant has an task to allow the execution of OS shell commands.<\/p>\n<p>Since many applications use a polyglot (many languages) model it comes with tasks for compiling C, C++, C#, and other languages. This is open source, users can extend the product by creating their own \u201cantlibs\u201d. (See the documentation on the Ant <a href=\"https:\/\/ant.apache.org\/\" target=\"_blank\" rel=\"noreferrer noopener\">website<\/a>).<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-3-installation\"><a name=\"installation\"><\/a>3. Installation<\/h2>\n<h3 class=\"wp-block-heading\" id=\"h-3-1-ubuntu\"><a name=\"ubuntu\"><\/a>3.1. Ubuntu<\/h3>\n<p>Use the apt-get install ant command to install it on Ubuntu. For other distributions, please check the documentation of your vendor.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-3-2-windows\"><a name=\"windows\"><\/a>3.2. Windows<\/h3>\n<p>a. Download the binary from ant.apache.org<br \/>NOTE: Use the 1.10.x version if you are running Java 8 (recommended). For minor versions (Java 5) use the 1.9.x version.<\/p>\n<p>b. Unzip the binary into a directory of your choice. For this tutorial, the Ant binary was unzipped into C:\\Ant<\/p>\n<p>c. Set the ANT_HOME environment variable to the directory where Ant was unzipped. For this tutorial: ANT_HOME=C:\\Ant<\/p>\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_EnvVarAntHome.jpg\"><img decoding=\"async\" width=\"450\" height=\"498\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_EnvVarAntHome.jpg\" alt=\"Apache Ant Tutorial - Set ANT_HOME System variable\" class=\"wp-image-49052\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_EnvVarAntHome.jpg 450w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_EnvVarAntHome-271x300.jpg 271w\" sizes=\"(max-width: 450px) 100vw, 450px\" \/><\/a><figcaption>Set ANT_HOME System variable<\/figcaption><\/figure>\n<\/div>\n<p>d. Edit the PATH system variable. Append &#8220;;%ANT_HOME%\\bin&#8221; (without the quotes).<\/p>\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_EnvVarPath.jpg\"><img decoding=\"async\" width=\"500\" height=\"214\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_EnvVarPath.jpg\" alt=\"Apache Ant Tutorial - Append to the PATH User variable\" class=\"wp-image-49053\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_EnvVarPath.jpg 500w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_EnvVarPath-300x128.jpg 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><figcaption>Append to the PATH User variable<\/figcaption><\/figure>\n<\/div>\n<h3 class=\"wp-block-heading\" id=\"h-3-3-testing-the-installation\"><a name=\"test_install\"><\/a>3.3. Testing the Installation<\/h3>\n<p>To test your Ant installation:<br \/>a. Open a command window and navigate to any directory which DOES NOT contain a build.xml file.<\/p>\n<p>b. Issue the command: ant<\/p>\n<p>You should receive the error message:<br \/>Buildfile: build.xml does not exist!<br \/>Build failed<\/p>\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_TestAntInstall.jpg\"><img decoding=\"async\" width=\"817\" height=\"235\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_TestAntInstall.jpg\" alt=\"Apache Ant Tutorial - Buiil Failed error message when installed\" class=\"wp-image-49057\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_TestAntInstall.jpg 817w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_TestAntInstall-300x86.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_TestAntInstall-768x221.jpg 768w\" sizes=\"(max-width: 817px) 100vw, 817px\" \/><\/a><figcaption>Error message appear if installed properly<\/figcaption><\/figure>\n<\/div>\n<h2 class=\"wp-block-heading\" id=\"h-4-anatomy-of-an-ant-project\"><a name=\"anatomy_ant_project\"><\/a>4. Anatomy of an Ant Project<\/h2>\n<p>As mentioned above it receives its instructions on how to build a particular project from an XML file. The default Ant project file is <i>build.xml<\/i>.<\/p>\n<p>The <em>build.xml <\/em>has the following basic structure:<\/p>\n<ul class=\"wp-block-list\">\n<li>Project &#8211; is the main tag of a build.xml Ant file. <\/li>\n<li>Task &#8211; are the processes that Ant can execute. It is provided and named by Ant (or plug-ins).<\/li>\n<li>Properties &#8211; the tags with the path and other configurations for Ant (e.g. source dir, output dir, etc&#8230;).<\/li>\n<li>Target &#8211; It is like a task but it is a user defined name.<\/li>\n<\/ul>\n<p>Note that we can have tasks and targets in the same Ant build file, but a target is defined by the user.<\/p>\n<p>Now, we&#8217;ll see each <em>build.xml<\/em> tag in detail.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-4-1-xml-declaration\"><a name=\"xml_decl\"><\/a>4.1. XML Declaration<\/h3>\n<p>Since the Ant build file is an XML file it begins with the typical declaration of an XML file with its version:<\/p>\n<div>\n<div id=\"highlighter_75116\" class=\"syntaxhighlighter  xml\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"xml plain\">&lt;?<\/code><code class=\"xml keyword\">xml<\/code> <code class=\"xml color1\">version<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"1.0\"<\/code> <code class=\"xml color1\">encoding<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"UTF-8\"<\/code><code class=\"xml plain\">?&gt;<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h3 class=\"wp-block-heading\" id=\"h-4-2-project-tag\"><a name=\"proj_tag\"><\/a>4.2. Project Tag<\/h3>\n<p>The &lt;project> element is the outer most element in this build file. It is a &#8220;container&#8221; for all of the properties, tasks, and targets that define the project contained in the build file.<\/p>\n<div>\n<div id=\"highlighter_134294\" class=\"syntaxhighlighter  xml\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">project<\/code> <code class=\"xml color1\">name<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"MyApplication\"<\/code> <code class=\"xml color1\">default<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"compile\"<\/code> <code class=\"xml color1\">basedir<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\".\"<\/code> <code class=\"xml plain\">&gt;&gt;<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>The &lt;project&gt; element has three attributes.<br \/>1. name: Set the name of the project contained in this file.<br \/>2. default: Set the default target to be executed by ant file.<br \/>3. basedir: Set the base directory (i.e.: root folder) of this project.<br \/>In this case &#8220;.&#8221; means the current directory. If this is omitted the parent directory of the build file will be used.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-4-3-tasks\"><a name=\"tasks\"><\/a>4.3. Tasks<\/h3>\n<p>Tasks are predefined individual units of work. Each task uses attributes set to values in order to customize the results of executing the task. Below are some examples of how set some of the &lt;delete&gt; task attributes to get different results:<\/p>\n<div>\n<div id=\"highlighter_344619\" class=\"syntaxhighlighter  xml\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">01<\/div>\n<div class=\"line number2 index1 alt1\">02<\/div>\n<div class=\"line number3 index2 alt2\">03<\/div>\n<div class=\"line number4 index3 alt1\">04<\/div>\n<div class=\"line number5 index4 alt2\">05<\/div>\n<div class=\"line number6 index5 alt1\">06<\/div>\n<div class=\"line number7 index6 alt2\">07<\/div>\n<div class=\"line number8 index7 alt1\">08<\/div>\n<div class=\"line number9 index8 alt2\">09<\/div>\n<div class=\"line number10 index9 alt1\">10<\/div>\n<div class=\"line number11 index10 alt2\">11<\/div>\n<div class=\"line number12 index11 alt1\">12<\/div>\n<div class=\"line number13 index12 alt2\">13<\/div>\n<div class=\"line number14 index13 alt1\">14<\/div>\n<div class=\"line number15 index14 alt2\">15<\/div>\n<div class=\"line number16 index15 alt1\">16<\/div>\n<div class=\"line number17 index16 alt2\">17<\/div>\n<div class=\"line number18 index17 alt1\">18<\/div>\n<div class=\"line number19 index18 alt2\">19<\/div>\n<div class=\"line number20 index19 alt1\">20<\/div>\n<div class=\"line number21 index20 alt2\">21<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"xml comments\">&lt;!--&nbsp; Deletes the file \/lib\/foo.jar --&gt;<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"xml spaces\">&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">delete<\/code> <code class=\"xml color1\">file<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"\/lib\/foo.jar\"<\/code><code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number3 index2 alt2\">&nbsp;<\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"xml comments\">&lt;!-- Deletes all files with the extension .txt from the current directory and any subdirectories --&gt;<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"xml spaces\">&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">delete<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">fileset<\/code> <code class=\"xml color1\">dir<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\".\"<\/code> <code class=\"xml color1\">includes<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"**\/*.txt\"<\/code><code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;\/<\/code><code class=\"xml keyword\">delete<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number8 index7 alt1\">&nbsp;<\/div>\n<div class=\"line number9 index8 alt2\"><code class=\"xml comments\">&lt;!--&nbsp; Deletes the build directory, including all of the files and subdirectories --&gt;<\/code><\/div>\n<div class=\"line number10 index9 alt1\"><code class=\"xml spaces\">&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">delete<\/code> <code class=\"xml color1\">dir<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"build\"<\/code><code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number11 index10 alt2\">&nbsp;<\/div>\n<div class=\"line number12 index11 alt1\"><code class=\"xml comments\">&lt;!-- Deletes the build directory, including all of the files and subdirectories--&gt;<\/code><\/div>\n<div class=\"line number13 index12 alt2\"><code class=\"xml plain\">&lt;!\u2014Same as above --&gt;<\/code><\/div>\n<div class=\"line number14 index13 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">delete<\/code> <code class=\"xml color1\">includeEmptyDirs<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"true\"<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number15 index14 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">fileset<\/code> <code class=\"xml color1\">dir<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"build\"<\/code><code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number16 index15 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;\/<\/code><code class=\"xml keyword\">delete<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number17 index16 alt2\">&nbsp;<\/div>\n<div class=\"line number18 index17 alt1\"><code class=\"xml comments\">&lt;!-- Deletes all files and subdirectories of build, but leave the build directory --&gt;<\/code><\/div>\n<div class=\"line number19 index18 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">delete<\/code> <code class=\"xml color1\">includeEmptyDirs<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"false\"<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number20 index19 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">fileset<\/code> <code class=\"xml color1\">dir<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"build\"<\/code><code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number21 index20 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;\/<\/code><code class=\"xml keyword\">delete<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>Ant comes with over 150 predefined tasks. The predefined tasks can be broken down into the following categories:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td>Archive Tasks<\/td>\n<\/tr>\n<tr>\n<td>Audit\/Coverage Tasks<\/td>\n<\/tr>\n<tr>\n<td>Compile Tasks<\/td>\n<\/tr>\n<tr>\n<td>Deployment Tasks<\/td>\n<\/tr>\n<tr>\n<td>Documentation Tasks<\/td>\n<\/tr>\n<tr>\n<td>EJB Tasks<\/td>\n<\/tr>\n<tr>\n<td>Execution Tasks<\/td>\n<\/tr>\n<tr>\n<td>File Tasks<\/td>\n<\/tr>\n<tr>\n<td>Java2 Extensions Tasks<\/td>\n<\/tr>\n<tr>\n<td>Logging Tasks<\/td>\n<\/tr>\n<tr>\n<td>Mail Tasks<\/td>\n<\/tr>\n<tr>\n<td>Miscellaneous Tasks<\/td>\n<\/tr>\n<tr>\n<td>Pre-process Tasks<\/td>\n<\/tr>\n<tr>\n<td>Property Tasks<\/td>\n<\/tr>\n<tr>\n<td>Remote Tasks<\/td>\n<\/tr>\n<tr>\n<td>SCM Tasks<\/td>\n<\/tr>\n<tr>\n<td>Testing Tasks<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>The Apache Ant User manual provides tables for each of the above categories showing the task name, a brief synopsis of what the task does and a link to the complete documentation. See Ant User Manual ( <a rel=\"noopener noreferrer\" href=\"https:\/\/ant.apache.org\/manual\/index.html\/\" target=\"_blank\">https:\/\/ant.apache.org\/manual\/index.html<\/a> ) &#8211;&gt; Table of Contents &#8211;&gt; Ant Tasks &#8211;&gt; Overview of Apache Ant Tasks.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-4-4-properties\"><a name=\"properties\"><\/a>4.4. Properties<\/h3>\n<p>Properties can be thought of as global constants that are immutable. However, they can be used throughout the project. Properties simply associate names with values. They are tasks which do not need to be enclosed within a &lt;target&gt; element. There is no limit to the number of &lt;property&gt; elements that can be defined.<\/p>\n<p>The most popular syntax for defining a &lt;property&gt; element takes one of these forms:<\/p>\n<div>\n<div id=\"highlighter_766014\" class=\"syntaxhighlighter  xml\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">01<\/div>\n<div class=\"line number2 index1 alt1\">02<\/div>\n<div class=\"line number3 index2 alt2\">03<\/div>\n<div class=\"line number4 index3 alt1\">04<\/div>\n<div class=\"line number5 index4 alt2\">05<\/div>\n<div class=\"line number6 index5 alt1\">06<\/div>\n<div class=\"line number7 index6 alt2\">07<\/div>\n<div class=\"line number8 index7 alt1\">08<\/div>\n<div class=\"line number9 index8 alt2\">09<\/div>\n<div class=\"line number10 index9 alt1\">10<\/div>\n<div class=\"line number11 index10 alt2\">11<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"xml comments\">&lt;!-- Sets the property foo to the value \"bar\" --&gt;<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">property<\/code> <code class=\"xml color1\">name<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"foo\"<\/code> <code class=\"xml color1\">value<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"bar\"<\/code><code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number3 index2 alt2\">&nbsp;<\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"xml comments\">&lt;!-- Sets the property foo to the value \"bar\" (Same as above) --&gt;<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">property<\/code> <code class=\"xml color1\">name<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"foo\"<\/code><code class=\"xml plain\">&gt;bar&lt;\/<\/code><code class=\"xml keyword\">property<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number6 index5 alt1\">&nbsp;<\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"xml comments\">&lt;!-- Reads a set of properties from a file called \"myproperties\" --&gt;<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">property<\/code> <code class=\"xml color1\">file<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"myproperties\"<\/code><code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number9 index8 alt2\">&nbsp;<\/div>\n<div class=\"line number10 index9 alt1\"><code class=\"xml comments\">&lt;!-- Reads a set of properties from \"<a href=\"http:\/\/www.awebsite.com\/props\/build.properties\">http:\/\/www.awebsite.com\/props\/build.properties<\/a>\" --&gt;<\/code><\/div>\n<div class=\"line number11 index10 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">property<\/code> <code class=\"xml color1\">url<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"<a href=\"http:\/\/www.mysite.com\/props\/build.properties\">http:\/\/www.mysite.com\/props\/build.properties<\/a>\"<\/code><code class=\"xml plain\">\/&gt;<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>To retrieve the value associated with a particular property; surround the property name with ${ } for example from the examples above <i>${foo}<\/i> would expand to <i>bar<\/i><\/p>\n<p>Ant provides a number of built in properties (taken from User Manual):<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td>basedir<\/td>\n<td>the absolute path of the project&#8217;s basedir (as set with the basedir attribute of &lt;&lt;project&gt;).<\/td>\n<\/tr>\n<tr>\n<td>ant.file<\/td>\n<td>the absolute path of the buildfile.<\/td>\n<\/tr>\n<tr>\n<td>ant.version<\/td>\n<td>the version of Ant ant.project.name the name of the project that is currently executing; it is set in the name attribute of &lt;project&gt;<\/td>\n<\/tr>\n<tr>\n<td>ant.project.default-target<\/td>\n<td>the name of the currently executing project&#8217;s default target; it is set via the default attribute of &lt;project&gt;<\/td>\n<\/tr>\n<tr>\n<td>ant.project.invoked-targets<\/td>\n<td>a comma separated list of the targets that have been specified on the command line (the IDE, an task &#8230;) when invoking the current project. This property is set properly when the first target is executed. If you use it in the implicit target (directly under the tag) the list will be empty if no target has been specified while it will contain the project&#8217;s default target in this case for tasks nested into targets.<\/td>\n<\/tr>\n<tr>\n<td>ant.java.version<\/td>\n<td>the JVM version Ant detected; currently it can hold the values &#8220;9&#8221;, &#8220;1.8&#8221;, &#8220;1.7&#8221;, &#8220;1.6&#8221;, &#8220;1.5&#8221;, &#8220;1.4&#8221;, &#8220;1.3&#8221; and &#8220;1.2&#8221;.<\/td>\n<\/tr>\n<tr>\n<td>ant.core.lib<\/td>\n<td>the absolute path of the ant.jar file.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h3 class=\"wp-block-heading\" id=\"h-4-5-targets\"><a name=\"targets\"><\/a>4.5. Targets<\/h3>\n<p>Target elements are user defined containers of tasks used to bring the build process to a known state. A powerful feature of targets is the <i>depends<\/i> attribute used to ensure targets are executed in the desired order.<\/p>\n<p>For example, given the following targets:<\/p>\n<div>\n<div id=\"highlighter_294945\" class=\"syntaxhighlighter  xml\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<div class=\"line number2 index1 alt1\">2<\/div>\n<div class=\"line number3 index2 alt2\">3<\/div>\n<div class=\"line number4 index3 alt1\">4<\/div>\n<div class=\"line number5 index4 alt2\">5<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">target<\/code> <code class=\"xml color1\">name<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"init\"<\/code> <code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">target<\/code> <code class=\"xml color1\">name<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"clean\"<\/code> <code class=\"xml color1\">depends<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"init\"<\/code> <code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">target<\/code> <code class=\"xml color1\">name<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"compile\"<\/code> <code class=\"xml color1\">depends<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"clean\"<\/code> <code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">target<\/code> <code class=\"xml color1\">name<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"manifest\"<\/code> <code class=\"xml color1\">depends<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"compile\"<\/code> <code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">target<\/code> <code class=\"xml color1\">name<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"buildJar\"<\/code> <code class=\"xml color1\">depends<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"manifest,compile,clean,init\"<\/code> <code class=\"xml plain\">\/&gt;<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>If the <i>buildJar<\/i> target is executed; from the <i>depends<\/i> attribute the expected order of target execution might be: <i>manifest<\/i> &#8211;&gt; <i>compile<\/i> &#8211;&gt; <i>clean<\/i> &#8211;&gt; <i>init<\/i> before executing the <i>buildJar<\/i> target, which is exactly backwards from the desired order (since it makes no sense to build the .jar file first, and perform the initialization task last). Fortunately when evaluating the order of targets to be executed, the depends attribute of the <i>buildJar<\/i> target depends on <i>manifest<\/i>, which depends on <i>compile<\/i>, which in turn depends on <i>clean<\/i>, which depends on <i>init<\/i>. Ant only executes a target once within a dependency chain so the targets are executed once and in the expected order.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-4-6-extension-points\"><a name=\"ext_points\"><\/a>4.6. Extension-Points<\/h3>\n<p>Extension-Points are targets without tasks. Introduced in Ant 1.8. Extension-points are executed from the command-line. The main purpose of extension-points is to execute the targets in its dependency list to bring the build process to the desired state.<\/p>\n<div>\n<div id=\"highlighter_685781\" class=\"syntaxhighlighter  xml\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">1<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">extension-point<\/code> <code class=\"xml color1\">name<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"build_source\"<\/code> <code class=\"xml color1\">depends<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"compile\"<\/code><code class=\"xml plain\">\/&gt;<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h2 class=\"wp-block-heading\" id=\"h-5-sample-project\"><a name=\"sample_proj\"><\/a>5. Sample Project<\/h2>\n<p>Here is the <i>build.xml<\/i> file that builds the three .java files into the <u>Using a Default Handler<\/u> Java application adapted from my earlier article &lt;a href=&#8221;https:\/\/examples.javacodegeeks.com\/core-java\/xml\/xpath\/java-xpath-using-sax-example\/&#8221;Java XPath Using SAX Example.<\/p>\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_ProjectStruct.jpg\"><img decoding=\"async\" width=\"774\" height=\"243\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_ProjectStruct.jpg\" alt=\"Apache Ant Tutorial - Sample project structure\" class=\"wp-image-49123\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_ProjectStruct.jpg 774w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_ProjectStruct-300x94.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2017\/08\/Final_ProjectStruct-768x241.jpg 768w\" sizes=\"(max-width: 774px) 100vw, 774px\" \/><\/a><figcaption>Structure of AntSample project<\/figcaption><\/figure>\n<\/div>\n<p>The root directory for the project is <i>proj<\/i>, and contains:<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td>build.xml<\/td>\n<td>The Ant build file for this project<\/td>\n<\/tr>\n<tr>\n<td>inventory.xml<\/td>\n<td>The XML data file used by the application after being copied to the <i>classes<\/i> directory (which is created during the build)<\/td>\n<\/tr>\n<tr>\n<td>SaxParse.bat<\/td>\n<td>Batch file to run the application<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>The <i>src<\/i> directory contains the three Java source files:<\/p>\n<figure class=\"wp-block-table\">\n<table>\n<tbody>\n<tr>\n<td>Computer.java<\/td>\n<td>&nbsp;<\/td>\n<\/tr>\n<tr>\n<td>JavaSAXParse.java<\/td>\n<td>Main class<\/td>\n<\/tr>\n<tr>\n<td>MyHandler.java<\/td>\n<td>&nbsp;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<p>Below is the build file \u2013 <i>build.xml<\/i>.<\/p>\n<div>\n<div id=\"highlighter_925156\" class=\"syntaxhighlighter  xml\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td class=\"gutter\">\n<div class=\"line number1 index0 alt2\">01<\/div>\n<div class=\"line number2 index1 alt1\">02<\/div>\n<div class=\"line number3 index2 alt2\">03<\/div>\n<div class=\"line number4 index3 alt1\">04<\/div>\n<div class=\"line number5 index4 alt2\">05<\/div>\n<div class=\"line number6 index5 alt1\">06<\/div>\n<div class=\"line number7 index6 alt2\">07<\/div>\n<div class=\"line number8 index7 alt1\">08<\/div>\n<div class=\"line number9 index8 alt2\">09<\/div>\n<div class=\"line number10 index9 alt1\">10<\/div>\n<div class=\"line number11 index10 alt2\">11<\/div>\n<div class=\"line number12 index11 alt1\">12<\/div>\n<div class=\"line number13 index12 alt2\">13<\/div>\n<div class=\"line number14 index13 alt1\">14<\/div>\n<div class=\"line number15 index14 alt2\">15<\/div>\n<div class=\"line number16 index15 alt1\">16<\/div>\n<div class=\"line number17 index16 alt2\">17<\/div>\n<div class=\"line number18 index17 alt1\">18<\/div>\n<div class=\"line number19 index18 alt2\">19<\/div>\n<div class=\"line number20 index19 alt1\">20<\/div>\n<div class=\"line number21 index20 alt2\">21<\/div>\n<div class=\"line number22 index21 alt1\">22<\/div>\n<div class=\"line number23 index22 alt2\">23<\/div>\n<div class=\"line number24 index23 alt1\">24<\/div>\n<div class=\"line number25 index24 alt2\">25<\/div>\n<div class=\"line number26 index25 alt1\">26<\/div>\n<\/td>\n<td class=\"code\">\n<div class=\"container\">\n<div class=\"line number1 index0 alt2\"><code class=\"xml plain\">&lt;?<\/code><code class=\"xml keyword\">xml<\/code> <code class=\"xml color1\">version<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"1.0\"<\/code> <code class=\"xml color1\">encoding<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"UTF-8\"<\/code><code class=\"xml plain\">?&gt;<\/code><\/div>\n<div class=\"line number2 index1 alt1\">&nbsp;<\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"xml comments\">&lt;!-- Project definition --&gt;<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">project<\/code> <code class=\"xml color1\">name<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"AntSample\"<\/code> <code class=\"xml color1\">basedir<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\".\"<\/code> <code class=\"xml color1\">default<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"compile\"<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number5 index4 alt2\">&nbsp;<\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml comments\">&lt;!-- Define properties needed for build --&gt;<\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">property<\/code> <code class=\"xml color1\">name<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"srcdir\"<\/code>&nbsp; <code class=\"xml color1\">value<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"src\"<\/code><code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">property<\/code> <code class=\"xml color1\">name<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"outdir\"<\/code>&nbsp; <code class=\"xml color1\">value<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"classes\"<\/code><code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number9 index8 alt2\">&nbsp;<\/div>\n<div class=\"line number10 index9 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml comments\">&lt;!-- Clean target.&nbsp; Delete the output directory. --&gt;<\/code><\/div>\n<div class=\"line number11 index10 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">target<\/code> <code class=\"xml color1\">name<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"clean\"<\/code> <code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number12 index11 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">delete<\/code> <code class=\"xml color1\">dir<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"${outdir}\"<\/code> <code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number13 index12 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;\/<\/code><code class=\"xml keyword\">target<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number14 index13 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code>&nbsp;<\/div>\n<div class=\"line number15 index14 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml comments\">&lt;!-- Init target.&nbsp; Create the output directory. if it does not exist. --&gt;<\/code><\/div>\n<div class=\"line number16 index15 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml comments\">&lt;!-- Copy inventory.xml to $(outdir) --&gt;<\/code><\/div>\n<div class=\"line number17 index16 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">target<\/code> <code class=\"xml color1\">name<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"init\"<\/code> <code class=\"xml color1\">depends<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"clean\"<\/code> <code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number18 index17 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">mkdir<\/code> <code class=\"xml color1\">dir<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"${outdir}\"<\/code> <code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number19 index18 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">copy<\/code> <code class=\"xml color1\">file<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"${basedir}\\inventory.xml\"<\/code> <code class=\"xml color1\">todir<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"${outdir}\"<\/code> <code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number20 index19 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;\/<\/code><code class=\"xml keyword\">target<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number21 index20 alt2\">&nbsp;<\/div>\n<div class=\"line number22 index21 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">target<\/code> <code class=\"xml color1\">name<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"compile\"<\/code> <code class=\"xml color1\">depends<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"init\"<\/code> <code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number23 index22 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;<\/code><code class=\"xml keyword\">javac<\/code> <code class=\"xml color1\">srcdir<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"${srcdir}\"<\/code> <code class=\"xml color1\">destdir<\/code><code class=\"xml plain\">=<\/code><code class=\"xml string\">\"${outdir}\"<\/code> <code class=\"xml plain\">\/&gt;<\/code><\/div>\n<div class=\"line number24 index23 alt1\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code><code class=\"xml plain\">&lt;\/<\/code><code class=\"xml keyword\">target<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<div class=\"line number25 index24 alt2\"><code class=\"xml spaces\">&nbsp;&nbsp;&nbsp;&nbsp;<\/code>&nbsp;<\/div>\n<div class=\"line number26 index25 alt1\"><code class=\"xml plain\">&lt;\/<\/code><code class=\"xml keyword\">project<\/code><code class=\"xml plain\">&gt;<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>To build the project:<br \/>1. Open a Command Prompt<br \/>2. Navigate to the root directory <i>\\AntSample\\proj<\/i><br \/>3. Issue the command: <i>ant<\/i><\/p>\n<p>To run the application:<br \/>1. Open a Command Prompt<br \/>2. Navigate to the root directory <i>\\AntSample\\proj<\/i><br \/>3. Issue the command: <i>SAXparse.bat<\/i><\/p>\n<h3 class=\"wp-block-heading\" id=\"h-5-1-using-ant-with-eclipse\">5.1 Using Ant with Eclipse<\/h3>\n<p>Now, we&#8217;ll take this example to the next level. We going to use Eclipse to wrap our code into a jar file and make Ant execute it.<\/p>\n<p>Eclipse already came with a tool that we can use to build or project. We can enable this tool in Window > Show View > Other > Ant > Ant. The view will appears in Eclipse Views tabs bottom.<\/p>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"800\" height=\"182\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-25-at-2.03.02-PM-1.png\" alt=\"\" class=\"wp-image-96706\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-25-at-2.03.02-PM-1.png 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-25-at-2.03.02-PM-1-300x68.png 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-25-at-2.03.02-PM-1-768x175.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><figcaption>Eclipse view tabs<\/figcaption><\/figure>\n<p id=\"h-\">In the sample for Eclipse some additions was made to create the jar file using target. However, the most important parts are the tasks <strong>jar<\/strong> and <strong>run<\/strong>.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Compile target<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;target name=\"jar\" depends=\"compile\"&gt;\n\t\t&lt;mkdir dir=\"${jardir}\"\/&gt;\n\t    \t&lt;jar destfile=\"${jardir}\/${ant.project.name}.jar\" basedir=\"${outdir}\"&gt;\n\t        \t&lt;manifest&gt;\n\t            \t&lt;attribute name=\"Main-Class\" value=\"${main-class}\"\/&gt;\n\t            &lt;\/manifest&gt;\n\t        &lt;\/jar&gt;\n\t&lt;\/target&gt; \n<\/pre>\n<p><span style=\"text-decoration: underline\"><em>Run target<\/em><\/span><\/p>\n<pre class=\"brush:xml\">&lt;target name=\"run\" depends=\"jar\"&gt;\n\t\t&lt;java jar=\"${jardir}\/${ant.project.name}.jar\" fork=\"true\"\/&gt;\n\t&lt;\/target&gt;\n<\/pre>\n<p>When the project is imported into Eclipse, we&#8217;ll see in the tab all the tasks that are inserted in build.xml.<\/p>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"800\" height=\"537\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-25-at-2.40.04-PM.png\" alt=\"\" class=\"wp-image-96713\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-25-at-2.40.04-PM.png 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-25-at-2.40.04-PM-300x201.png 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/10\/Screen-Shot-2020-10-25-at-2.40.04-PM-768x516.png 768w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n<p>To compile and execute the application, double click in run task and see the result in Console tab with all tasks been executed in order.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-6-for-more-information\">6. For More Information<\/h2>\n<p>For more information consult the Java Ant Use Manual.<\/p>\n<p>A copy of the manual is included with the Ant download. If you installed Java Ant, then your copy can be found at %ANT_HOME%\\manual\\index.html.<\/p>\n<p>An online copy can be found at <a href=\"https:\/\/ant.apache.org\/manual\/index.html\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/ant.apache.org\/manual\/index.html<\/a><\/p>\n<h2 class=\"wp-block-heading\" id=\"h-7-download-the-source-code\"><a name=\"proj_download\"><\/a>7. Download the Source Code<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>You can download the full project for this tutorial here: <a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/10\/AntSamples.zip\"><strong>Apache Ant Tutorial for Beginners<\/strong><\/a><\/div>\n<p><strong>Last updated on Oct. 29th, 2020<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial explains why Java Apache Ant was created and its advantages over other build tools. It also covers the installation of Ant and what goes into a java ant project. 1. Apache Ant Tutorial &#8211; Introduction In this tutorial, a sample project is set up. The Ant build file, for the sample project, is &hellip;<\/p>\n","protected":false},"author":107,"featured_media":15858,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[727],"tags":[1073,189],"class_list":["post-48999","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ant","tag-apache","tag-core-java-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Apache Ant Tutorial for Beginners - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"This tutorial explains why Java Apache Ant was created and its advantages over other build tools. It also covers the installation of Ant and what goes\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apache Ant Tutorial for Beginners - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"This tutorial explains why Java Apache Ant was created and its advantages over other build tools. It also covers the installation of Ant and what goes\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2017-08-09T08:00:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-17T11:34:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/apache-ant-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"David Guinivere\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Guinivere\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/\"},\"author\":{\"name\":\"David Guinivere\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6b72a73c5929404de88a306c107735ed\"},\"headline\":\"Apache Ant Tutorial for Beginners\",\"datePublished\":\"2017-08-09T08:00:07+00:00\",\"dateModified\":\"2021-05-17T11:34:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/\"},\"wordCount\":1823,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/apache-ant-logo.jpg\",\"keywords\":[\"apache\",\"core java\"],\"articleSection\":[\"ANT\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/\",\"name\":\"Apache Ant Tutorial for Beginners - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/apache-ant-logo.jpg\",\"datePublished\":\"2017-08-09T08:00:07+00:00\",\"dateModified\":\"2021-05-17T11:34:09+00:00\",\"description\":\"This tutorial explains why Java Apache Ant was created and its advantages over other build tools. It also covers the installation of Ant and what goes\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/apache-ant-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/apache-ant-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Core Java\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"apache\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/apache\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"ANT\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/apache\/ant\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"Apache Ant Tutorial for Beginners\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6b72a73c5929404de88a306c107735ed\",\"name\":\"David Guinivere\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/11\/David-Guinivere-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/11\/David-Guinivere-96x96.jpg\",\"caption\":\"David Guinivere\"},\"description\":\"David graduated from University of California, Santa Cruz with a Bachelor\u2019s degree in Information Science. He has been actively working with Java since the days of J2SE 1.2 in 1998. His work has largely involved integrating Java and SQL. He has worked on a wide range of projects including e-commerce, CRM, Molecular Diagnostic, and Video applications. As a freelance developer he is actively studying Big Data, Cloud and Web Development.\",\"sameAs\":[\"https:\/\/www.javacodegeeks.com\",\"http:\/\/www.linkedin.com\/in\/davidguinivere\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/david-guinivere\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apache Ant Tutorial for Beginners - Java Code Geeks","description":"This tutorial explains why Java Apache Ant was created and its advantages over other build tools. It also covers the installation of Ant and what goes","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:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/","og_locale":"en_US","og_type":"article","og_title":"Apache Ant Tutorial for Beginners - Java Code Geeks","og_description":"This tutorial explains why Java Apache Ant was created and its advantages over other build tools. It also covers the installation of Ant and what goes","og_url":"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2017-08-09T08:00:07+00:00","article_modified_time":"2021-05-17T11:34:09+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/apache-ant-logo.jpg","type":"image\/jpeg"}],"author":"David Guinivere","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"David Guinivere","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/"},"author":{"name":"David Guinivere","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6b72a73c5929404de88a306c107735ed"},"headline":"Apache Ant Tutorial for Beginners","datePublished":"2017-08-09T08:00:07+00:00","dateModified":"2021-05-17T11:34:09+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/"},"wordCount":1823,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/apache-ant-logo.jpg","keywords":["apache","core java"],"articleSection":["ANT"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/","url":"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/","name":"Apache Ant Tutorial for Beginners - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/apache-ant-logo.jpg","datePublished":"2017-08-09T08:00:07+00:00","dateModified":"2021-05-17T11:34:09+00:00","description":"This tutorial explains why Java Apache Ant was created and its advantages over other build tools. It also covers the installation of Ant and what goes","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/apache-ant-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/10\/apache-ant-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/apache-ant-tutorial-beginners\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"},{"@type":"ListItem","position":3,"name":"Core Java","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/"},{"@type":"ListItem","position":4,"name":"apache","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/apache\/"},{"@type":"ListItem","position":5,"name":"ANT","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/apache\/ant\/"},{"@type":"ListItem","position":6,"name":"Apache Ant Tutorial for Beginners"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/6b72a73c5929404de88a306c107735ed","name":"David Guinivere","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/11\/David-Guinivere-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/11\/David-Guinivere-96x96.jpg","caption":"David Guinivere"},"description":"David graduated from University of California, Santa Cruz with a Bachelor\u2019s degree in Information Science. He has been actively working with Java since the days of J2SE 1.2 in 1998. His work has largely involved integrating Java and SQL. He has worked on a wide range of projects including e-commerce, CRM, Molecular Diagnostic, and Video applications. As a freelance developer he is actively studying Big Data, Cloud and Web Development.","sameAs":["https:\/\/www.javacodegeeks.com","http:\/\/www.linkedin.com\/in\/davidguinivere"],"url":"https:\/\/examples.javacodegeeks.com\/author\/david-guinivere\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/48999","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/107"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=48999"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/48999\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/15858"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=48999"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=48999"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=48999"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}