gpt4 book ai didi

maven - 'parent.relativePath' 指向我的 com.mycompany :MyProject instead of org. apache :apache - Why?

转载 作者:行者123 更新时间:2023-12-03 04:30:42 28 4
gpt4 key购买 nike

事实是,Solr 项目目录位于 MyProject 父目录内(但两者之间没有模块或任何 Maven 关系,只是 FS 方便)。我必须把它拿出来吗?

$ mvn -DskipTests clean install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.apache.lucene:lucene-solr-grandparent:pom:3.1-SNAPSHOT
[WARNING] 'parent.relativePath' points at com.mycompany:MyProject instead of org.apache:apache, please verify your project structure @ line 23, column 11
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]

来自pom.xml:

<parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>8</version>
</parent>

$ pwd
/Users/simpatico/ws/MyProjectBaseDir/solr

最佳答案

添加一个 <relativePath><parent>以便它解析存储库中的父 pom。

  <parent>
<groupId>org.apache</groupId>
<artifactId>apache</artifactId>
<version>8</version>
<relativePath></relativePath>
</parent>

这是相关的doc .

This feature is only for enhancing the development in a local checkout of that project. Set the value to an empty string in case you want to disable the feature and always resolve the parent POM from the repositories.
Default value is: ../pom.xml.

关于maven - 'parent.relativePath' 指向我的 com.mycompany :MyProject instead of org. apache :apache - Why?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6003831/

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