maven relativePath

时间:2022-11-09 09:36:16 类型:JAVA
字号:    
  1. relativePath 是Maven为了寻找父模块pom.xml所额外增加的一个寻找路径

  2. relativePath 默认值为 …/pom.xml

Maven 寻找父模块pom.xml 的顺序如下:

(1) first in the reactor of currently building projects

    这里一个maven概念 反应堆(reactor ),

    意思就是先从工程里面有依赖相关的模块中找你引入的parent 的pom.xml,

(2) then in this location on the filesystem然后从 你定义的  <relativePath > 路径中找,

    当然你如果只是 /  即空值,则跳过该步骤,  

    默认值 ../pom.xml 则是从上级目录中找啦。

(3)  then the local repository

      这个就不说了,如果 (1) (2) 步骤没有则从 本地仓库找啦。

(4) and lastly in the remote repo

     最后只能从远程仓库找啦,再找不到就报错给你看


<