Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What approach of improving incremental building of the maven projects do you prefer?

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:

  1. Incremental-build-plugin Maven Mojo
  2. Maven 2 Reactor Plugin

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:

  1. Are my conclusions that these two plugins solve almost the same problem right?
  2. Do anybody has any experience using both of these plugin and able to give any feed back about them?
  3. Do you have other ideas of optimization of the building?
like image 378
vedi Avatar asked Feb 16 '12 07:02

vedi


1 Answers

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)
like image 179
Georg Avatar answered Oct 26 '22 23:10

Georg