[ 
http://jira.codehaus.org/browse/MNG-4639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=253165#action_253165
 ] 

Jerome Lacoste commented on MNG-4639:
-------------------------------------

For those who are interested in this feature:

* hudson already does this for you (at least in the maven3 support). the time 
for the mojos is stored in the build.xml (Search for ExecutedMojo). There's 
also a per module page summary on hudson that will display time used per mojo
* you can implement the same in maven by looking at 
  
http://maven.apache.org/ref/3.0.2/maven-core/apidocs/org/apache/maven/execution/AbstractExecutionListener.html.
 This is used in  and 
./maven-embedder/src/main/java/org/apache/maven/cli/ExecutionEventLogger.java 
and instantiated by 
maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java
  You might for example want to add a new 'profiling' option. Not to confuse 
with maven profiles..
* if you are interested by the downloads time, you might want to look at 
./maven-embedder/src/main/java/org/apache/maven/cli/AbstractMavenTransferListener.java
  but as downloads might happen in parallel, I am not sure you will get the 
information you want (i.e. user time spent waiting for download to complete)

Hope that helps.

> Be able to profile a maven build
> --------------------------------
>
>                 Key: MNG-4639
>                 URL: http://jira.codehaus.org/browse/MNG-4639
>             Project: Maven 2 & 3
>          Issue Type: New Feature
>            Reporter: Baptiste MATHUS
>             Fix For: Issues to be reviewed for 3.x
>
>
> A common problem with builds is that they can become quite long to run. As it 
> is a know anti-pattern for CI for example, one has the need to try and 
> optimize their builds.
> The thing is: the current granularity isn't sufficiently precise. In fact, 
> you only only the time spent to build each module. This is a good start, 
> though.
> Maven currently displays something like the following (let's speak only about 
> maven 3):
> {quote}
> [INFO] Reactor Summary:
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] p1 ........................ SUCCESS [1:12.938s]
> [INFO] p2 ........................ SUCCESS [5.750s]
> [INFO] p3 ........................ SUCCESS [3:58.488s]
> [INFO] p4 ........................ SUCCESS [24.437s]
> [INFO] p5 ........................ SUCCESS [1.563s]
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time: 5 minutes 46 seconds
> {quote}
> What would be great would be adding an option that would higher the details. 
> Something like -A/--analyze (--profile would be too close to -P/profile 
> option) would add detailed analysis, would print something like. 
> {quote}
> [INFO] Reactor Summary:
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] p1 ........................ SUCCESS [1:12.938s]
>         clean:clean (somepkg.CleanMojo) : 10.3s
>         compiler:compile (...) : 50s
>         ...
>         and so on
> {quote}
> I'm not very well aware the level of details maven 3 API could provide. So 
> the printing above could become irrelevant. In this case, printing a 
> dedicated html or so report might be a better choice.
> Cheers
> PS : Though I'm really not introduced into maven code, if you think it's not 
> too complicated, I could try and contribute on this field if I'm given some 
> hints or good starting points. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to