Maven Coordinates: groupId, artifactId, version (GAV)
Fast recall
Quick revision
Core answer
groupId:artifactId:version; complete coordinates can also include type and classifier, which distinguish variants such as a test JAR. groupId names the publishing namespace, artifactId names the module, and version selects a release. Maven version strings are not required to follow Semantic Versioning.Basic Maven fluency — GAV coordinates appear in every pom.xml dependency declaration and are essential for dependency resolution
Confusing groupId with package name or not understanding that groupId prevents naming collisions between different organizations
Explain that Maven coordinates solve the namespace collision problem — two organizations can publish artifacts with the same artifactId as long as their groupIds differ, like com.google.guava:guava vs com.github.ben-manes.caffeine:caffeine
Interview-ready guide
Interview answer
Maven coordinates are the unique identifier for any library or module in the Maven world.
- 0The groupId is the organization namespace using reverse-domain format — it's like the publisher of the library.
For example, org dot springframework means it's published by the Spring team. The artifactId is the specific module name within that organization, so spring-boot-starter-web is one particular library they publish. The version selects the artifact version using the producer's versioning scheme.
When you add a dependency to your pom dot XML, you specify these three pieces and Maven uses them to find and download the right JAR file. The coordinates solve a critical problem: two different companies could both have a library called utils, but com dot google colon utils and com dot company colon utils are completely different artifacts that won't collide.
Maven converts coordinates into file paths — the groupId becomes nested directories, then artifactId, then version. One mistake freshers make is using random groupIds like my dot project instead of proper reverse-domain names. When you publish to Maven Central, you have to prove you own that domain, so always use something like io dot github dot yourusername if you don't have a company domain.
Maven Coordinates: groupId, artifactId, version (GAV)
Direct Answer
Maven identifies a dependency with coordinates. The common form is groupId:artifactId:version; complete coordinates can also include type and classifier, which distinguish variants such as a test JAR. groupId names the publishing namespace, artifactId names the module, and version selects a release. Maven version strings are not required to follow Semantic Versioning.
Code Example
// pom.xml dependency section showing GAV coordinates
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId> // Organization namespace
<artifactId>spring-boot-starter-data-jpa</artifactId> // Specific module
<version>3.2.0</version> // Release version
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>8.2.0</version>
<scope>runtime</scope> // Only needed at runtime, not compile time
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.30</version>
<scope>provided</scope> // Compile-time only, not packaged
</dependency>
</dependencies>
// These coordinates map to repository paths:
// org/springframework/boot/spring-boot-starter-data-jpa/3.2.0/spring-boot-starter-data-jpa-3.2.0.jar
Common Mistakes & Pitfalls
- Using arbitrary groupId values: Freshers often invent groupIds like my.project or test.app instead of reverse-domain names. This causes publication rejections and namespace collisions. Always use a domain you control: com.yourcompany or io.github.yourusername.
- Confusing groupId with Java package names: The groupId doesn't have to match your code's package structure. groupId is an organizational namespace for Maven artifacts, while packages organize Java classes. They often align by convention (org.springframework groupId with org.springframework.boot packages), but it's not required.
- Forgetting that artifactId should be globally unique within groupId: Two modules in your organization can't have the same artifactId even if they're in different Git repos — the groupId plus artifactId must uniquely identify the module across all your projects.
Check your understanding
Answer these without looking back at the article.
- What is a SNAPSHOT version vs a release version?
- What is the difference between groupId and package name?
Looking for a structured roadmap?
Every module on this page is also part of the full Java backend interview track.