What Is pom.xml?
Fast recall
Quick revision
Core answer
pom.xml is Maven's Project Object Model. A minimal standalone Maven 4 POM declares modelVersion, groupId, artifactId, and version; packaging defaults to jar. A child can inherit groupId and version from a parent. When present, the parent element must appear after modelVersion and before the project's own artifact coordinates.Whether you understand Maven's core configuration file structure and can identify what's mandatory versus optional in a pom.xml
Thinking packaging, name, or dependencies are required elements when they're actually optional with sensible defaults
Explain the effective POM concept — Maven merges your pom.xml with parent POMs and the super POM to create the actual configuration used during builds
Interview-ready guide
Interview answer
xml file is Maven's project configuration file — it's the first thing Maven looks for in your project root.
POM stands for Project Object Model, which means Maven treats your project as an object with properties and behaviors rather than just a pile of source files. There are four required elements you must have. 0 and tells Maven which POM schema version you're using.
techcorp. Third is artifactId, which is your project name — this becomes part of your JAR filename. 0-SNAPSHOT for development versions.
Everything else is optional but commonly added.
For example, packaging defaults to jar if you don't specify it. xml directly. It merges your file with any parent POM you've inherited from, plus Maven's built-in super POM that provides defaults.
You can see the final merged result by running mvn help:effective-pom. That's why you sometimes see behavior you didn't explicitly configure — it's coming from parent POMs.
What Is pom.xml
Direct Answer
pom.xml is Maven's Project Object Model. A minimal standalone Maven 4 POM declares modelVersion, groupId, artifactId, and version; packaging defaults to jar. A child can inherit groupId and version from a parent. When present, the parent element must appear after modelVersion and before the project's own artifact coordinates.
Code Example
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>order-service</artifactId>
<version>1.0.0-SNAPSHOT</version>
</project>
packaging is omitted here, so it defaults to jar. In a child POM, a <parent> block goes immediately after modelVersion, and the child may inherit groupId and version.
Common Mistakes & Pitfalls
- Forgetting modelVersion: Freshers copy-paste partial pom.xml examples without the modelVersion element, causing Maven to fail with cryptic errors. Always include modelVersion as 4.0.0 — this hasn't changed since Maven 2.0.
- Using incorrect groupId conventions: Writing groupId as MyCompany instead of the reverse domain format com.mycompany breaks Maven's coordinate uniqueness guarantee.
- Confusing artifactId with the JAR filename: The final JAR name is artifactId-version.jar by default, but freshers sometimes expect the name element to control the filename.
- Not understanding version semantics: Using 1.0.0 when you mean 1.0.0-SNAPSHOT — without SNAPSHOT, Maven treats it as a release version and won't re-download it from repositories.
Check your understanding
Answer these without looking back at the article.
- What is a parent POM?
- What is the Spring Boot starter parent?
Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.