There are good resources on the web that shows how you can decrease the Maven build times of Java projects, but since I couldn’t find the following information in most of them, I wanted to note this down for future reference. One of the simplest things you can do to decrease the Maven build time is to add the following to your command line:
mvn clean package -Pnative -Pdist -DskipTests -Dtar
Maven reports that build took about 8.5 minutes.
whereas building the same project by skipping the Javadoc generation:
mvn clean package -Dmaven.javadoc.skip=true -Pnative -Pdist -DskipTests -Dtar
the build time goes down to approximately 1.5 minutes.
Going down to 1.5 minutes from about 8.5 minutes simply by using a single additional option to Maven is not a bad win I suppose, especially if you are in the business of patching, building and deploying some big open source projects for testing, such as Hadoop, and you don’t need any Javadoc.
These numbers are from a desktop machine, running Ubuntu GNU/Linux 15.04, Oracle Java version 1.8.0_45, and Maven version 3.3.9. The machine has 16 GB of RAM, INTEL i7-4790 CPU with 8 cores, and a Samsung SSD 850 disk with 500 GB capacity.