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:
- Are my conclusions that these two plugins solve almost the same problem right?
- Do anybody has any experience using both of these plugin and able to give any feed back about them?
- Do you have other ideas of optimization of the building?
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:
The reactor plugin is more for when you want to build only a subset of your modules within a build, the incremental plugin is more aimed at only building those modules which have changed since the last compile.
While I can see you using either to the same effect, you probably are more interested in the incremental build plugin from what you have said. Whether you can use the two together to make sure you only build the modules/dependencies you need if they have uncompiled changes I don't know.
PS - I think the clean bug has been fixed in the latest incremental build plugin release.
Have you tried using Jenkins (or Hudson)? It's pretty nice and managing many small, dependent projects. It's also very easy to set up on a server. I would recommend at least trying it. To set up a server and configure 20 maven projects only takes a few minutes.
The thing I like about it is that it'll monitor your source control and execute a build every X minutes, and it will successively build any upstream projects automatically.