+91 90691 39140 | +1 253 214 3115 | info@hub4tech.com | hub4tech

Ant Interview Questions and Answers

1
Explain the concepts and capabilities of ANT.

Ant is a build tool that is java based. A build tool performs the following tasks:

  • Compiling java code into byte code
  • Placing this byte code in a package
  • Deployment to production systems
  • Document creation and release notes preparation.

Capabilities of ANT:

ANT tool is extended by using java classes. The configuration files are XML-based. Each task of building directory tree is executed by using the object that implements the Task interface.

ANT provides the cross-platform deployment that can run on any platform.

2
What is ANT?

ANT full form is Another Needed Tool. Ant is a build tool that is java based. A build tool performs the following tasks:

Compiling java code into byte code
Placing this byte code in a package
Deployment to production systems
Document creation and release notes preparation.

3
Explain how to make ant user interactive.

The org.apache.tools.ant.input.InputHandler interface is used to implement the user input. To perform the user input, the application creates InputRequest object and this object will be passed to InputHandler. The user input will be rejected if it is invalid.
The InputHandler interface has exactly one method, by name handleInput(InputRequest request). This method throws org.apache.tools.ant.BuildException, if the input is invalid.

4
Explain ANT functionality.

Ant is an open source project available under the Apache license. Therefore, its source code can be downloaded and modified.

Additionally, Ant uses XML build files which make its development easy.
Cross Platform.

Use of XML along with Java makes Ant makes it the perfect solution for developing programs designed to run or be built across a range of different operating systems.
Extensible.

New tasks are used to extend the capabilities of the build process, while build listeners are used to help hook into the build process to add extra error tracking functionality.

As Ant is extensible and open, it can be integrated with any editor or development environment easily.

5
Explain how to use ant-contrib tasks.
  • Copy the ant-contrib.jar to the directory ant*/lib. Copy ant-contrib.jar to your ant*/lib directory.
  • Append the following code snippet to avail all the ant-contrib tasks.
Copyright ©2015 Hub4Tech.com, All Rights Reserved. Hub4Tech™ is registered trademark of Hub4tech Portal Services Pvt. Ltd.
All trademarks and logos appearing on this website are the property of their respective owners.
FOLLOW US