Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the use of pom.xml in Maven?

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?

like image 556
Hazel_arun Avatar asked Feb 06 '13 09:02

Hazel_arun


People also ask

What is POM XML used for?

POM is an XML file that contains the project configuration details used by Maven. It provides all the configurations required for a project. POM means Project Object Model, and, as the name suggests, it defines the model of the project as well.

What is advantage of POM XML?

Maven is so useful thanks to the Project Object Model (POM), which is an XML file that has all the information regarding project and configuration details. The POM has the description of the project, details regarding the versioning, and configuration management of the project.

Is POM XML necessary?

pom. xml is required for building project using Maven. You might import jars manually in eclipse but for building the project in some other build system which supports Maven, you would need pom.

What is difference between POM and POM XML?

POM stands for Project Object Model, and it is the core of a project's configuration in Maven. It is a single configuration XML file called pom. xml that contains the majority of the information required to build a project.


1 Answers

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.

like image 189
basiljames Avatar answered Sep 20 '22 15:09

basiljames