I have a maven-built java project where the test
phase takes approximately 1 hour.
However, after moving to mvnd
(https://github.com/apache/maven-mvnd), tests now take ~32 minutes. (Further, I also tried graalVM with a native
Profile in POM. However, no noticeable difference is seen.)
It is a multi-module project and I have a feeling the test phase can still run within a fraction of 32 minutes If there was a mechanism to analyse the tests needed to be run based on something like the below:
So, first of all, one should try to make the local builds faster, i.e.
test
phase to the integration-test
phaseWhen the long running tests are only part of integration-test
, you can avoid running them locally, you just run them on the build server.
On the build server, you can try to construct a pattern as you described. How you exactly do this depends of course on the build server you use.
The general approach could be:
mvn clean deploy -pl module1,module2 -amd
. This will automatically figure out the dependant modules.