Wednesday, May 21, 2008

Maven Build Profiling

I've often wished I had a tool that could provide a high-level profile of the build execution. I'm not talking about running the entire build on a profiler -- while that might be the ultimate goal, it's probably overkill, and harder to read than something simpler.

For instance, Maven 2 has a build lifecycle and plugins that tie into that. If Maven 2 could generate a report that indicated how long each phase of the build lifecycle took, possibly breaking out each pre- and post- phase, as well as each of the plugin executions, that'd be a terrific way to make a quick start on reducing the time of a particular build.

For instance, if your project has a fifteen minute build, but you're spending 13 of the 15 on the integration-test phase, then you have a pretty good idea right away on what your options are with respect to cutting down the build time (profiling the integration tests, reducing the number of integration tests, run integration tests only in CI, etc.).

I don't have enough Maven plugin development experience to argue if this is something that could be plugged into Maven easily, or not -- it seems as if the Maven plugin approach is better suited to things that execute at particular places in the lifecycle rather than interleaving with the lifecycle.

No comments: