gpt4 book ai didi

Maven:版本似乎影响 relativePath

转载 作者:行者123 更新时间:2023-12-02 04:58:55 25 4
gpt4 key购买 nike

当父 pom 的版本不同但相对路径相同时,我得到两个不同的结果。根据我对 relativePath 标签的有限理解,relativePath 压倒了版本,但看起来版本优先于 relativePath。 relativePath 不适用于版本吗?以下有什么区别:

<parent>com.company.thing</product>
<groupId>a-pom-file</groupId>
<version>a</version>
<relativePath>../pom.xml</relativePath>
</parent>

<parent>com.company.thing</product>
<groupId>a-pom-file</groupId>
<version>b</version>
<relativePath>../pom.xml</relativePath>
</parent>

最佳答案

不,相对路径不会压倒版本。版本必须正确且可用。它必须在存储库、默认位置(pom 文件是当前项目的上一级目录)或您指定的相对路径中可用。因此,在您的场景中,relativePath 实际上没有任何效果,因为默认情况下,Maven 将在此处查找您的父 pom。

http://maven.apache.org/guides/introduction/introduction-to-the-pom.html#Project_Inheritance

关于Maven:版本似乎影响 relativePath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18751750/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com