Relative Path in Maven Parent Definition

When defining a parent artifact, do I need to include in the child pump? For instance,

Is <relativePath>optional or required?

<parent>
    <groupId>org.hibernate.tutorials</groupId>
    <artifactId>hibernate-tutorials</artifactId>
    <version>5.1.0.Final</version>
    <relativePath>../pom.xml</relativePath>
</parent>
+4
source share
1 answer

This is not required. From the docs :

relativePath: relative path of the parent file pom.xmlas part of the scan. If not specified, the default value is ../pom.xml. [...]

This means that you can omit this element and by default will have what you already have, i.e. Maven will look for the parent POM in ../pom.xml, which is one directory up.

+3
source

All Articles