문제

I have a Maven multi-module project and I need two different parent POMs in this build. The first one is the real parent POM for most modules in the project but one module is a demo project which uses the parent POM of a completely different project (because it's a demo how to use my project to generate code for the second project).

The build works but I get a warning:

[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] 

Since other_project is not really a module of my build, it can be anywhere. This means I can't give a relative path.

How can I fix this warning?

도움이 되었습니까?

해결책

The solution in this case is to set the relativePath to nothing to overwrite the default ../pom.xml:

<relativePath/>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top