I am working on a Maven multi-modules project. I want to build a given module and skip the unit tests to speed the build process up.
I've tried the following:
mvn reactor:make -Dmake.folders=search -Dgoals=package,-DskipTests
mvn reactor:make -Dmake.folders=search -Dgoals=package -Dmaven.test.skip=True
However, this does not have an effect at all. Any clues?
Your first line looks like the right idea, but instead of -Dgoals
you should use -Dmake.goals
.
From the reactor plugin examples page:
The reactor plugin launches a second copy of Maven to do its magic. This copy of Maven doesn't necessarily have all of the flags and options that you passed to your first copy of Maven, including the --debug flag, system properties, and -DskipTests.
You can pass additional arguments to the spawned Maven by treating them as goals with -Dmake.goals, like this:
mvn reactor:resume -Dmake.folders=barBusinessLogic -Dmake.goals=install,-DskipTests
In other words, the "goals" are just extra command-line parameters passed to the spawned Maven; they don't necessarily have to be "goals."
If you want to get really fancy, you may prefer to just dry run the reactor plugin in -Dmake.printOnly mode, described above. That will print out the command that the plugin would have used to build, but you can tweak that command line to your heart's content!