The pom.xml and Project Coordinates

Harry · 14 Sep 2026 · 3 views
Advertisement
Advertisement

A minimal pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.example</groupId>
  <artifactId>shop</artifactId>
  <version>1.0.0</version>
  <packaging>jar</packaging>

  <properties>
    <maven.compiler.release>17</maven.compiler.release>
  </properties>

  <dependencies>
  </dependencies>
</project>

Coordinates: GAV

Every Maven project – and every dependency – is uniquely identified by three coordinates, universally abbreviated GAV:

  • groupId – the organisation, in reverse-domain form: com.example.
  • artifactId – the project name: shop.
  • version – the release: 1.0.0.

Together they name the artifact: com.example:shop:1.0.0. This is exactly how you reference any library in the world.

Packaging

<packaging> decides the output: jar for a library or app, war for a servlet-container web app, pom for a parent that only aggregates modules.

Properties and the parent POM

<properties> holds reusable values like the Java version. Many projects also declare a <parent> – for example spring-boot-starter-parent – which supplies sensible defaults and a curated set of dependency versions so you do not have to specify them yourself.

Key points

  • The pom.xml is the single file describing a Maven project.
  • GAV (groupId, artifactId, version) uniquely identifies every project and dependency.
  • <packaging> chooses the output type: jar, war or pom.
  • Properties centralise values; a parent POM supplies defaults and managed versions.
Share this post:

Comments (0)

Please login or register to comment.