Maven

Maven Pom.xml

Maven – Introduction to the POM

POM is an acronym for Project Object Model. The pom.xml file contains information of project and configuration information for the maven to build the project such as dependencies, build directory, source directory, test source directory, plugin, goals etc.Maven reads the pom.xml file, then executes the goal.

Before maven 2, it was named as project.xml file. But, since maven 2 (also in maven 3), it is renamed as pom.xml.

 

POM also contains the goals and plugins. While executing a task or goal, Maven looks for the POM in the current directory. It reads the POM, gets the needed configuration information, and then executes the goal. Some of the configuration that can be specified in the POM are following −

  • project dependencies
  • plugins
  • goals
  • build profiles
  • project version
  • developers
  • mailing list

Before creating a POM, we should first decide the project group (groupId), its name (artifactId) and its version as these attributes help in uniquely identifying the project in repository

Example pom.xml

Pom - Automation laboratories

It should be noted that there should be a single POM file for each project.

  • All POM files require the project element and three mandatory fields: groupId, artifactId, version.
  • Projects notation in repository is groupId:artifactId:version.

Refer YouTube link below for better Explanation

[youtube https://www.youtube.com/watch?v=CBll4xZb0aw&w=560&h=315]

 
Abhishek on FacebookAbhishek on Linkedin
Abhishek

Leave a Reply

Your email address will not be published. Required fields are marked *