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

2 Answers 2


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.

  • 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, 2010 at 11:43
  • 1
    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, 2010 at 11:46
  • Suppose I am developing a Struts2 Web app...then how will they help me?
    – shahensha
    Dec 23, 2010 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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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