bash maven pom 调用子目录中的其他 pom

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18859221/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 06:36:14  来源:igfitidea点击:

maven pom to call other poms in sub directories

javalinuxbashmaven

提问by tgkprog

Have a project where we have 8 Projects in Eclipse, each with its own pom.xml

有一个项目,我们在 Eclipse 中有 8 个项目,每个项目都有自己的 pom.xml

Right now call them via an sh file (series of cd, mvns, sleep for 3 seconds so we can see if error and ctrl-c)

现在通过 sh 文件调用它们(一系列 cd、mvns、sleep 3 秒,以便我们可以查看是否有错误和 ctrl-c)

Is there a way to call the various poms from within another master pom and only continue if current project mvn ran successfully?

有没有办法从另一个主 pom 中调用各种 pom 并且只有在当前项目 mvn 成功运行时才继续?

If not via maven then via ant or other plug in / linux script edits? Example please.

如果不是通过 maven 那么通过 ant 或其他插件 / linux 脚本编辑?请举例。

回答by clearwater

One possibility is using a multi-module Maven project as described on this page: http://books.sonatype.com/mvnex-book/reference/multimodule.html

一种可能性是使用本页所述的多模块 Maven 项目:http: //books.sonatype.com/mvnex-book/reference/multimodule.html

A code example can be found in section 6.2 (http://books.sonatype.com/mvnex-book/reference/multimodule-sect-simple-parent.html).

代码示例可以在第 6.2 节(http://books.sonatype.com/mvnex-book/reference/multimodule-sect-simple-parent.html)中找到。

Hope it helps.

希望能帮助到你。