Skip to Content

Maven timeline plugin

I often work with my customers on shortening the build process. Very often it’s a Maven build.

An easy way of making a multi-modules build shorter is to use Maven’s parallel build feature with something like mvn -T2 clean install

However, that’s not always as effective as one could think. Because of dependencies between modules, not all modules can be build in parallel. In fact, if you could look at how many modules are really run in parallel, you’d be surprised it’s only a few. All your nice CPU cores mostly spend their time doing nothing.

Because it’s not easy to guess which modules are waited by which, I wrote a small maven extension that plugs into the build lifecycle and measures the time taken by each phase. The results are then output to a target/timeline.html file for easier visualisation.

Here’s what the html file looks like:

Timeline

Here’s the maven-timeline plugin. (It should be synched with maven central later today)

Feel free to fix bugs and do whatever you want with this plugin.

comments powered by Disqus