搭建maven项目,子模块指定父模块试,经常会在parent下面出现relativePath类似下面:
net.itxw test0.0.1-SNAPSHOT
这个下面的属性是什么意思?
其实很明显,就是parent的路径,具体来说就是你引用这个parent项目,那parent项目的pom在哪里?
1.默认值默认我们不用写,那默认值就是 …/pom.xml,会从本地路径中获取parent的pom
2.这样写,也就是说我指定了relativePath,但值是空的,设定一个空值将始终从仓库中获取,不从本地路径获取.
查找顺序:relativePath元素中的地址–本地仓库–远程仓库
很常见的场景就是使用springboot的时候
3.一个pom路径org.springframework.boot spring-boot-starter-parent2.2.0.RELEASE
这种也很显然,指定一个本地的路径,从本地路径获取parent的pom。
参考:https://blog.csdn.net/zzhongcy/article/details/122085513
https://blog.csdn.net/jiangyu1013/article/details/94319284


![[1122]maven pom relativePath属性的作用 [1122]maven pom relativePath属性的作用](http://www.mshxw.com/aiimages/31/785815.png)
