We have a very large multi-language project that’s built at the top level by a Makefile that has each component depend on all of its proper dependent projects. Therefore, when you run make -j from the top level, the make program will build several components at once in order to parallelize this large build process. To date, we’ve had to place artificial dependencies between our several maven projects in order to serialize maven builds on the host because if maven is executed on multiple projects at the same time, we often run into maven repository management collisions.
Can Gradle solve this issue for us? Can Gradle be used in parallel on a single host against a single artifact repository?
Thanks in advance!
Unlike maven, Gradle can happily use a single local repository for multiple Gradle builds. Whether that’s multiple subprojects in a multi module project building in parallel. Or totally separate gradle builds fired in parallel from separate processes.
To continue this discussion it’s probably best to state which approach you are currently taking (single multi-module maven build or multiple separate maven builds)
For a single multi-module build, Gradle will build subprojects that don’t depend on each other in parallel if you specify
--parallel at command line or set the property
org.gradle.parallel=true. So, if you convert your maven projects to gradle you should be able to benefit from parallel execution. Note that tasks within a single subproject will never run in parallel
If you find there’s specific tasks that should never run in parallel with one another, you can hack a dummy output directory that you configure on each of the tasks that must run in serial. More info here