What is the use of pom.xml in Maven?

Hazel_arun picture Hazel_arun · Feb 6, 2013 · Viewed 52k times · Source

I have just started working with Maven in Eclipse.

I tried running a sample program in it, and I encountered some problems. The errors were in my pom.xml file. What is the significance of the pom.xml file in Maven?

Answer

basiljames picture basiljames · Feb 6, 2013

In short the pom.xml will have all information to build your project.

For example you want to build a project and you have only the pom.xml sent to you via mail. If there are enough entries in the pom.xml then that is all you need! You can import it to Eclipse, Maven will download your source code from CVS, download various dependency jars (like Spring, Apache Commons), run your test cases, build the jar/war, deploy to your jboss/app server, generate a report of your code quality (using Sonar, maybe). Each task you want to do will be mentioned as a goal.

The links already provided are good enough for reference.