Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can somebody please tell me in simple words what exactly is ant build file and maven build file?

share|improve this question

They are XML files that describe how to build and package software (usually Java software).

Ant files are used by the Ant tool, which provides more flexible, free-form builds. An Ant build file is much like a program in its own right (only encoded as verbose XML).

POM files are used by Maven, which has a different philosophy and imposes more structure. The Maven approach is more declarative than Ant. Writing a Maven build is less like writing a procedural program to build the software.

share|improve this answer
So basically, they are sort of a template for us to build on...they do not provide any ready-made functionality! right? – shahensha Dec 22 '10 at 11:43
The tools provide the functionality (e.g. compilation, archiving, running unit tests) and the XML files define how this functionality is used. – Dan Dyer Dec 22 '10 at 11:46
Suppose I am developing a Struts2 Web app...then how will they help me? – shahensha Dec 23 '10 at 5:58

They're just like any other build files (NAnt, make, ...).

They describe the steps taken to produce some kind of artifact - an executable file, a test run, etc.

The build file will describe how to create a clean build environment, what to compile, where the dependencies are that you need to compile, where to put the executables, DLLs, and the like, any additional programs you need to execute (like running your testrunner on your project, or instrumenting your code so a coverage tool can analyse your test coverage).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.