是否可以将多模块 pom 作为父多模块 pom 的模块?
所需的结构是这样的
Projects/pom.xml
项目/parent1/pom.xml
项目/parent2/pom.xml
项目/parent2/child1/pom.xml
Projects/parent2/child2/pom.xmlparent1
- 和parent2是Projects/pom.xml的模块
- child1和child2是parent2的模块
- parent2/pom.xml的包装类型是pom。
- 我没有在子 poms 中使用父标签
如果我调用父 poms,则 child1 和 child2 会正确构建。 items/pom.xml 只是作为构建所有父项目的收集器而存在。
当我运行 mvn clean -pl Parent2 child1 和 child2 时,甚至无法识别。这是默认行为吗?
The required structure is like this
Projects/pom.xml
Projects/parent1/pom.xml
Projects/parent2/pom.xml
Projects/parent2/child1/pom.xml
Projects/parent2/child2/pom.xml
- parent1 and parent2 are module of Projects/pom.xml
- child1 and child2 are modules of parent2
- The packaging type of parent2/pom.xml is pom.
- I have not used the parent tag in the child poms
If I call the parent poms then child1 and child2 are built correctly. The projects/pom.xml exists just as a collector to build all the parent projects.
When I run mvn clean -pl parent2 child1 and child2 are not even recognized. Is this the default behaviour?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当然应该是可以的。看看 Sonatype maven 参考书中的这个示例。
如果没有看到 pom 文件,恐怕我们将无法为您提供更多帮助。你可以发布它们吗?
It should be possible certainly. Have a look at this example in the Sonatype maven reference book.
Without seeing the pom files, I'm afraid we will not be able to help you much further. Can you post them?