maven parallel builds

maven 3.x has bought in a great feature, the possibility of parallel builds.

mvn -T 4 clean install # Builds with 4 threads
mvn -T 1C clean install # 1 thread per cpu core
mvn -T 1.5C clean install # 1.5 thread per cpu co

 I have been doing some experiments with this parallel builds on our projects. And I found it does reduce the time of the builds. And i tried to use mvn -T 1.5C and it was around 40% faster in my case. We have 20 projects building on the Jenkins continuous build server and the complete build used to take around 1 hour before with maven 2. After switching to maven 3, we used this experimental feature. And so far it seems to be working great. It has reduced the build time to around 40 minutes. We have 8 Cores on that build machine.
 

Update : 27.11.2015
  I was using this feature in jenkins to build my projects and somehow the system used to get out of memory quite often. I am still not sure about this. But this was the feature what I changed in jenkins and the system seemed to not like it.

Like this post? Don’t forget to share it!

Leave a Reply

Your email address will not be published. Required fields are marked *