是否可以将多模块 pom 作为父多模块 pom 的模块?

发布于 2024-12-26 03:51:28 字数 471 浏览 4 评论 0原文

所需的结构是这样的

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南笙 2025-01-02 03:51:28

当然应该是可以的。看看 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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文