"parent.relativePath"指向我的com.mycompany:MyProject而不是org.apache:apache-为什么? [英] 'parent.relativePath' points at my com.mycompany:MyProject instead of org.apache:apache - Why?

查看:160
本文介绍了"parent.relativePath"指向我的com.mycompany:MyProject而不是org.apache:apache-为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

真实的是,Solr项目目录位于MyProject父目录内(但是2之间没有模块或任何Maven关系,只是FS方便)​​.我必须把它放出来吗?

What is true is that Solr project directory is inside MyProject parent directory (but there's no module or any maven relationship between the 2, just FS convenience). Do I have to place it out?

$ 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

推荐答案

<parent>添加 <relativePath>,以便从存储库解析父pom.

Add an empty <relativePath> to <parent> so that it resolves the parent pom from the repositories.

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

这是相关的文档.

此功能仅用于增强该项目的本地结帐中的开发.如果要禁用该功能并始终从存储库中解析父POM,请将值设置为空字符串.
默认值为:../pom.xml.

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.

这篇关于"parent.relativePath"指向我的com.mycompany:MyProject而不是org.apache:apache-为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆