且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

“不可解析的父POM:无法传输伪像"尝试使用$ {parent.groupid}从子pom引用父pom时

更新时间:2021-12-18 02:11:28

似乎您正在尝试从父级继承groupId,同时使用继承的groupId指定父级!

Looks like you're trying to both inherit the groupId from the parent, and simultaneously specify the parent using an inherited groupId!

在子pom中,使用类似以下的内容:

In the child pom, use something like this:

<modelVersion>4.0.0</modelVersion>

<parent>
  <groupId>org.felipe</groupId>
  <artifactId>tutorial_maven</artifactId>
  <version>1.0-SNAPSHOT</version>
  <relativePath>../pom.xml</relativePath>
</parent>

<artifactId>tutorial_maven_jar</artifactId>

无法使用像${project.groupId}这样的属性.如果以这种方式指定父级,则可以继承子pom中的groupId和版本.因此,您只需要在子pom中指定artifactId.

Using properties like ${project.groupId} won't work there. If you specify the parent in this way, then you can inherit the groupId and version in the child pom. Hence, you only need to specify the artifactId in the child pom.