By default the Ant editor only has an association with <b>build.xml</b> named files. So right now we are creating a file called build.xml in your application with the following contents in it.
<?xml version="1.0"?> <project name="Hello World" default="info" basedir="."> <target name="info"> <echo>Hello World - Welcome to Apache Ant Tutorial!!!</echo> </target> </project>
All build files require the project element and at least one target element. As per as our build file there is XML element project has three attributes as below.
Now move to another XML element of Ant Build file build.xml is target. A target is a collection of tasks that you want to run as one unit. Targets can have dependencies on other targets. Let see below
<target name="clean" description="cleans up the build by deleting the build,dist, web directories"> ...... </target> <target name="init" depends="clean" description="Setup for build script"> ...... </target> <target name="compile" depends="init" description="Compiles .java files to WAR directory"> ...... </target> <target name ="makejar" description="Create a jar for the AlgoTest project" depends="compile"> ...... </target>
As per as we have define targets in the above file have dependencies such as a makejar target may have a dependency on the compile target and compile target may have dependency on the init target and init target may have dependency on the clean target.
The target element has the following attributes:
To run the ant build file, open up command prompt and navigate to the folder where the build.xml resides, and type ant info.
Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…
Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…
Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…
Technology has emerged a lot in the last decade, and now we have artificial intelligence;…
Managing a database is becoming increasingly complex now due to the vast amount of data…
Overview In this article, we will explore Spring Scheduler how we could use it by…