Aar*_*lla 3 maven-2 relative-path multi-module parent-pom
我有一个Maven多模块项目,并且在此版本中需要两个不同的父POM。第一个是项目中大多数模块的真正父POM,但是一个模块是演示项目,它使用完全不同的项目的父POM(因为这是演示如何使用我的项目为第二个项目生成代码)。
构建工作,但我得到警告:
[WARNING]
[WARNING] Some problems were encountered while building the effective model for my_project:my_project.demo:jar:5.0.0-SNAPSHOT
[WARNING] 'parent.relativePath' points at my_project:parent instead of other_project:parent, please verify your project structure @ line 5, column 10
[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]
Run Code Online (Sandbox Code Playgroud)
由于other_project实际上并不是我构建的模块,因此它可以在任何地方。这意味着我不能给出相对路径。
如何解决此警告?
在这种情况下,解决方案是将设置relativePath为none以覆盖默认值../pom.xml:
<relativePath/>
Run Code Online (Sandbox Code Playgroud)