Parallel projects execution
In order to speed up your tests execution you can use options parallelThreads
. This will be the number of maven forked process in parallel. When terminated with "C", the number part is multiplied by the number of processors (cores) available to the Java virtual machine.
Example configuration:
<project> ... <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-invoker-plugin</artifactId> <version>3.8.0</version> <configuration> <parallelThreads>2C</parallelThreads> </configuration> </plugin> </plugins> </build> ... </project>
Order of projects execution in parallel mode
When use parallel, at any point, at most parallelThreads
threads will be active for projects executions.
Projects are send to execute by available thread in non guaranteed sequence, the most time it is determined by file system ordering. Internally java.io.File#list()
is used for scanning projects.
Some of projects can take more time and some can finish quicker. Next projects from queue will be executed as soon as thread in pool will be available. So order of executing can change, depends on many thing, like available processor, current system load etc...
If you need be sure of execution sequence, you can use invoker.ordinal
property in Invoker Properties
In parallel mode projects are grouped by invoker.ordinal
and projects from each groups are running in parallel. Projects from next group will start running after all projects from previous group are finished.
Setup
projects are executed first in sequential always on one thread.