Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to time (profile) maven goals in a multi-module project

We have a huge project with many submodules. A full build takes currently over 30mins.

I wonder how this time distributes over different plugins/goals, e.g. tests, static analysis (findbugs, pmd, checkstyle, etc ...)

Would it be possible to time the build to see where (in both dimensions: modules and goals) most time is spent?

like image 333
Bastl Avatar asked Feb 28 '11 15:02

Bastl


2 Answers

The maven-buildtime-extension is a maven plugin that can be used to see the times of each goal:

https://github.com/timgifford/maven-buildtime-extension

like image 165
Tim Andersen Avatar answered Sep 28 '22 16:09

Tim Andersen


If you run the build in a CI server like TeamCity or Jenkins (formerly Hudson), it will give you timestamps for every step in the build process and you should be able to use these values to determine which goals/projects are taking the most time.

I don't think there is any way built in to maven to do this. In fact, in the related question artbristol posted, there is a link to a Maven feature request for this functionality. Unfortunately, this issue is unresolved and I don't know if it will ever be added.

The other potential solution is to write your own plugin which would provide this build metadata for you.

like image 40
Jesse Webb Avatar answered Sep 28 '22 16:09

Jesse Webb