在没有根项目的情况下,如何在Maven3中执行反应堆构建? [英] How do you perform a reactor build in Maven3 without a root project?
问题描述
在没有根项目的情况下,如何在多个Maven项目上执行临时反应堆?
How does one perform an ad-hoc reactor build over multiple maven projects without a root project?
过去在maven2中可以通过使用带有-r选项的mvn命令来实现,该选项将从工作目录中递归搜索项目,并在反应堆中组织它们以正确的顺序进行构建,即使项目没有共享一个共同的父pom.xml.可以选择使用maven.reactor.includes和maven.reactor.excludes选项专门包括或排除某些项目.
This used to be possible in maven2 by invoking the mvn command with the '-r' option which would search recursively from the working directory for projects and organize them in the reactor to build in the correct order even if the projects did not share a common parent pom.xml. Optionally one could specifically include or exclude certain projects using maven.reactor.includes and maven.reactor.excludes option.
我意识到从maven3中删除了传统的反应堆模式,但是我不知道如何使用类似make"的反应堆模式来实现此功能.
I realize that the legacy reactor mode was removed from maven3 but I can't figure out how to achieve this functionality using the 'make-like' reactor mode.
推荐答案
在 MNG-4260 .
The "Maven 2"-style reactor feature has been removed following this discussion on the mailing list. The relevant JIRA issue is MNG-4260.
如上面的评论所述,最好使用<modules>
部分创建一个顶级pom,其中列出了包含项目的目录. (如果您不总是同时构建所有项目,则可以在配置文件中放置单独的modules
部分.)
As mentioned in the comments above, it's best to create a top-level pom with a <modules>
section that lists the directories containing projects. (If you don't always build all of your projects at the same time, you can put separate modules
sections in profiles).
这篇关于在没有根项目的情况下,如何在Maven3中执行反应堆构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!