user1154644
user1154644

Reputation: 4609

Inheriting from the Parent POM file

I am trying to understand an instruction for inheritance from a root pom file to a mid level pom file. The instruction says:

Define your parent pom file inheritance and groupid, artifactid (but not the version), from the mid level parents to the root pom file.

Does this mean that I should not specify a version for my mid level poms, or do not specify the group id and artifact id for the mid level poms?

Upvotes: 0

Views: 114

Answers (2)

H-H
H-H

Reputation: 4631

A Maven artifact is identified by the triplet: groupID - artifacID - version. When you specify a parent pom for your mid-level pom, you should normally specify the complete identity (triplet) of the parent pom. In you case where you only defined the groupID - artifacID of the parent pom, Maven searches for the highest available version in your local repository, to identify completely and retrieve the parent pom.

Upvotes: 1

Robert Scholte
Robert Scholte

Reputation: 12345

When including a parent, that tag must contain a groupId, artifactId and version. That will also mean, that your project only requires an artifactId, so that the coordinates are unique again.

Upvotes: 1

Related Questions