0

Is there a possibility to compile in a maven project 2 modules concurrently, if they don't have mutual dependency? (Java)

Example: I have a pom.xml (project) which has 3 modules - A, B and C.

C is dependent on B. B and A are not dependent on anything.

So, when drawing the dependency DAG, it seems that we have 2 roots: A and B. Can we run maven in such a concurrent way, that A and B will start concurrently, and C will be started after compilation of B?

Genry
  • 1,358
  • 2
  • 23
  • 39

1 Answers1

1

Maven 3.x has the capability to perform parallel builds. The command is as follows:

mvn -T 2 clean install # Builds with 2 threads
mvn -T 4C clean install# 4 thread per cpu core
mvn -T 2.5C clean install # 2.5 thread per cpu core

You can find out more here.

user987339
  • 10,519
  • 8
  • 40
  • 45