Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Maven父定义中的相对路径_Maven - Fatal编程技术网

Maven父定义中的相对路径

Maven父定义中的相对路径,maven,Maven,在定义父工件时,我是否需要在子工件的pom中包含父工件?比如说, 是可选的还是必需的 <parent> <groupId>org.hibernate.tutorials</groupId> <artifactId>hibernate-tutorials</artifactId> <version>5.1.0.Final</version> <relativePath>.

在定义父工件时,我是否需要在子工件的pom中包含父工件?比如说,

是可选的还是必需的

<parent>
    <groupId>org.hibernate.tutorials</groupId>
    <artifactId>hibernate-tutorials</artifactId>
    <version>5.1.0.Final</version>
    <relativePath>../pom.xml</relativePath>
</parent>

org.hibernate.tutorials
hibernate教程
5.1.0.1最终版本
../pom.xml
这不是必需的。发件人:

relativePath
:签出中父级
pom.xml
文件的相对路径。如果未指定,则默认为
。/pom.xml
。[……]

这意味着您可以省略此元素,它将默认为您已经拥有的内容,即Maven将在
。/POM.xml
中查找父POM,这是一个目录