Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Explain using ant and give an small example?



Explain using ant and give an small example?..

Answer / Khushal Singh Gaival

To use Ant, create a build.xml file containing targets and tasks. A simple example might include a target named `build` that compiles source files (using the javac task) and creates a JAR file (using the jar task). Here is a minimal example:

```xml
<project name="My Project" default="build">
<target name="build">
<javac srcdir="src" destdir="bin"/>
<jar jarfile="myapp.jar" basedir="bin"/>
</target>
</project>
```
In this example, the build target compiles all .java files within the `src` directory and places the compiled .class files in the `bin` directory, then creates a JAR file called myapp.jar with all .class files within the `bin` directory.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apache Ant Interview Questions

How to use ant to run commandline command? How to get perl script running result?

1 Answers  


Explain how to debug my ant script?

1 Answers  


How to set classpath in ant script?

1 Answers  


How to hide password input?

1 Answers  


How we can deploy file on server using ant?

1 Answers  


What are the core concepts of ant?

1 Answers  


What are the capabilities of ant?

1 Answers  


How we can set path path and classpath into an ant build file?

1 Answers  


How you can clean or delete workspace using ant?

1 Answers  


Why ant is a great build tool?

1 Answers  


How you can explain ant property?

1 Answers  


Explain how to test classes for junit using ant script?

1 Answers  


Categories