I am going to optimize time of building our projects. One of the most time-consuming thing is a compilation of the projects.
Due to known problem of the maven mentioned in particular here: Maven incremental building we have to use mvn clean before every building process.
I have investigated this question and found out two approaches:
I have tested Incremental-build-plugin Maven Mojo and it looks pretty good. As I see Maven 2 Reactor Plugin implements almost the same functionality but the special command should be specified to achieve results (mvn reactor:make for instance).
So I have made conclusion that Maven 2 Reactor Plugin is more convenient only for developers if they are going to optimize time of the buildings on their local computers. But I have some hesitation because Maven 2 Reactor Plugin is hosted and (as I think) is supported as official maven plugin, but Incremental-build-plugin Maven Mojo is hosted on java.net.
And my questions are:
Both plugins mentioned above won't speed up your compile time for your usecase. if you want to speed up your compile time I'd propose you update to maven 3 with parallel build support.
However, what is done with the plugins described above can also be achieved out of the box with maven3, except the svn related features of the reactor plugin. for this you'd need jenkins as mentioned in the previous post.
useful maven 3 features to speed up your build:
mvn clean compile -T 3 (using three threads for paralell builds)
mvn -amd -pl groupid:arifactId (builds the specified projects and all dependent artifacs)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With