Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you perform a reactor build in Maven3 without a root project?

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.

like image 250
Dev Avatar asked Apr 22 '11 01:04

Dev


People also ask

What is Reactor build order in Maven?

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.

What is reactor build?

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.

How do I run a multi-module project in Maven?

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.


1 Answers

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).

like image 141
Martin Ellis Avatar answered Sep 20 '22 03:09

Martin Ellis