How does one perform an ad-hoc reactor build over multiple maven projects without a root project?
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.
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.
The Reactor This part of the Maven core does the following: Collects all the available modules to build. Sorts the projects into the correct build order. Builds the selected projects in order.
Cook nuclear power plant. Reactor buildings are used for containment of nuclear reactors and many components of a nuclear power plant, to ensure maximum safety in operation and in the event of an accident.
A multi-module project is built from an aggregator POM that manages a group of submodules. In most cases, the aggregator is located in the project's root directory and must have packaging of type pom. The submodules are regular Maven projects, and they can be built separately or through the aggregator POM.
The "Maven 2"-style reactor feature has been removed following this discussion on the mailing list. The relevant JIRA issue is MNG-4260.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With