Maven Pom.xml File

POM is short form of Project Object Model. Maven POM file in the project describe the resources of the project. This include all dependencies, directories of source code, test, plugin, goals etc. The POM file is named pom.xml. In earlier version of Maven (before 2.0) the name of this file was project.xml after version 2.0 it had changes to pom.xml. The pom file should be located into the root directory of the project.

Maven Pom.xml File

POM file also has inheritance concept means a project divided into sub-projects. So parent project has one POM file and each sub-project have own POM file with inheriting parent POM file into the parent project. So with this structure we can built a project in one step including all sub-projects or either we can build one sub-project separately.

Maven reads the pom.xml file, then executes the goal.

Whenever we are creating POM file in our project first we should decide the project group id (i.e. groupId) and its name (i.e. artifactId) and its version for versioning of project in the repository it help in identifying.

Here is a minimal POM file:

<project xmlns=""


XML elements of Maven POM file

  1. project-It is the root XML element of POM file.
  2. modelVersion-It is the sub element of project. It specifies the modelVersion. It should be set to 4.0.0.
  3. groupId-It is name of group or organization of project. It is the sub element of project element.
  4. artifactId– It is name of project (~artifact) what we are creating and it is the sub element of project element. An artifact is something that is either produced or used by a project.
  5. version-It specifies the version of the artifact under given group.

The above groupId, artifactId and version elements would result in a JAR file being built and put into the local Maven repository at the following path:


As above listed elements are mandatory. All POM files require at least the project element and three mandatory fields: groupId, artifactId, version.

Super POM
All Maven POM files inherit from a super POM. If no super POM is specified, the POM file inherits from the base POM just like Object class in java.

<project xmlns=""


An inheriting POM file may override settings from a super POM. Just specify new settings in the inheriting POM file

Maven Super POM

An easy way to look at the default configurations of the super POM is by running the following command: mvn help:effective-pom

Spring Boot Related Topics

  1. Spring Boot Interview Questions and Answers
  2. Introduction to Spring Boot
  3. Essentials and Key Components of Spring Boot
  4. Spring Boot CLI Installation and Hello World Example
  5. Spring Boot Initializr Web Interface
  6. Spring Boot Initializr With IDEs
  7. Spring Boot Initializr With Spring Boot CLI
  8. Installing Spring Boot
  9. Developing your first Spring Boot application
  10. External Configurations for Spring Boot Applications
  11. Logging Configuration in Spring Boot
  12. Spring Boot and Spring MVC
  13. Working with SQL Databases and Spring Boot
  14. MySQL Configurations
  15. Spring Data JPA using Spring Boot Application
  16. Spring Boot with NoSQL technologies
  17. Spring Cache Tutorial
  18. Spring Security Tutorial with Spring Boot
  19. Spring Boot and MongoDB in REST Application
  20. Complete Guide for Spring Boot Actuator
  21. Microservices with Spring Boot