In our “big build” (40+ modules), we have several modules that contain only tests.
When I give -DskiptTests to mvn, the tests are not executed.
But they are compiled, which costs up to a minute of build time.
How can I selectively turn off such modules when the option skipTests is set?
You’d have to organize your root pom such that the test modules are activated via a profile, and instead of using
-Dmaven.test.skipto turn use-P!testProfileto deactivate them and hence skipping them.Another thought is that you could just do:
I haven’t actually tried that… it should in theory work. I seem to remember that the
<skip>configuration is on all plugins.