November 2021
maven_verify_multi_module - Focused test execution of specific modules in a Maven multi-module project.
maven_verify_multi_module
[-g (compile|install)]
[-s] [-h] target-module(s)
Running tests on a (complex) Maven multi-module project for a specifc target module can be time consuming. This script helps to ‘compile’ or ‘install’ the dependencies for that target module and runs the test of that target module afterwards.
This helper requires either a local Maven wrapper (mvnw) or a globally installed Maven executable.
-g (compile|install),
--dependencies-goal=(compile|install)Whether to execute the ‘compile’ or ‘install’ goal for the dependencies. (defaults to “compile”)
-s, --skip-dependencies-tests,
--no-skip-dependencies-testsWhether to skip tests on dependencies build phase or not. (defaults to “false”)
-h, --helpPrints help
The target module(s) for which the tests should be run for. Comma-separated if multiple modules should be targeted.
successful execution
error while parsing command line arguments
no valid Maven executable found
If the multi-module project requires to install the dependencies, use
the -g argument with the value set to
“install”:
$ maven_verify_multi_module -g install my-module-name
To skip running tests of the target module(s) dependencies use the
-s flag:
$ maven_verify_multi_module -s my-module-name
To run MVVM for multiple target modules, use a comma-separated list of module names:
$ maven_verify_multi_module mod1,mod2
mvn(1)