{"id":543,"date":"2012-12-20T09:34:16","date_gmt":"2012-12-20T16:34:16","guid":{"rendered":"http:\/\/10kdev.ivystreetinc.com\/?p=543"},"modified":"2012-12-20T09:42:36","modified_gmt":"2012-12-20T16:42:36","slug":"maven-3-multithreading","status":"publish","type":"post","link":"http:\/\/10kdev.net\/?p=543","title":{"rendered":"Maven 3 Multithreading"},"content":{"rendered":"<p>Maven 3 multithreading works very well &#8211; as long as your plugins support it! \u00a0It&#8217;s still in an experimental mode but we are using it on our project to cut our build times in half. \u00a0And its much easier to implement than Ant&#8217;s parallel thread\u00a0functionality.\u00a0\u00a0 \u00a0On another project with Ant I multithreaded our build \u00a0\u2013 would take out almost 25% with parallelizing ant builds. \u00a0Maven claims a 50% reduction and I believe it.<\/p>\n<p>So . . .<em><strong>good news<\/strong><\/em> \u2013 it works great.<\/p>\n<p><em><strong> Bad news<\/strong><\/em> \u2013 not all plugins are set up for multithreading yet (from Maven), like sonar, so it can\u2019t be used it in a full build process yet.\u00a0 You could probably write a two-step process though; one multithreaded and one not.<\/p>\n<h3>Running<\/h3>\n<p style=\"padding-left: 30px;\"><strong><em>mvn -T 4 clean install<\/em><\/strong> &#8211;&gt;ran our build with 4 total threads, cuts build time almost in half!<\/p>\n<p>I have an 8-core machine, so if I run it with one thread per core:<\/p>\n<p style=\"padding-left: 30px;\"><strong><em>mvn \u2013T 1C clean install<\/em><\/strong> &#8211;&gt; goes even faster, 8 threads on my machine and saved almost 75% of the time needed to build!<\/p>\n<p>Here\u2019s Maven\u2019s documentation:<\/p>\n<p><a href=\"https:\/\/cwiki.apache.org\/MAVEN\/parallel-builds-in-maven-3.html\">https:\/\/cwiki.apache.org\/MAVEN\/parallel-builds-in-maven-3.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Maven 3 multithreading works very well &#8211; as long as your plugins support it! \u00a0It&#8217;s still in an experimental mode but we are using it on our project to cut our build times in half. \u00a0And its much easier to implement than Ant&#8217;s parallel thread\u00a0functionality.\u00a0\u00a0 \u00a0On another project with Ant I multithreaded our build \u00a0\u2013 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/543"}],"collection":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=543"}],"version-history":[{"count":5,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/543\/revisions"}],"predecessor-version":[{"id":547,"href":"http:\/\/10kdev.net\/index.php?rest_route=\/wp\/v2\/posts\/543\/revisions\/547"}],"wp:attachment":[{"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=543"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10kdev.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}