jcgay/maven-profiler

Report appears under first child-module instead of under root

jakub-bochenski opened this issue · 6 comments

running mvn -Dprofile compile results in no output

running mvn -Dprofile compile -N results in timings for the root module only (pretty useless)

I just noticed output appears under the first module's directory instead... it seems data for all modules is there.

Sill I think the .profiler/ should appear under the execution root.

jcgay commented

It makes sense.

I think it should also log where the report has been written, it will just be easier to open the report.

I think it should also log where the report has been written, it will just be easier to open the report.

How about making it a mojo param, with default being ${session.executionRootDirectory}/.profiler?
Nvm, forgot this is not a mojo but an extension.
Yes printing some summary (and also a starting message) can be helpful since now there is nothing in console to tell if the profiler is active or not.

PS. I might have been unclear in the report above. What I mean by "first" module is.

Given a structure like:

  pom.xml
  module1/pom.xml
  module2/pom.xml

When I run mvn at the root the report appears under module1/.profiler, I'd expect it to appear under .profiler.

If I run mvn -N the report appear under .profiler, but it's obviously just for the root aggregator module.

jcgay commented

Oops what you describe is not the intented behavior :(

I will try to reproduce it with a simple multi modules, my first two attempts with exsiting projects was a failure...

I think the lines 83 and 89 are responsible.

If you can get hold of the session object or just the ${session.executionRootDirectory} property saving the file there might fix it.

I don't have time to debug this now, but looking at the code the above misbehaviour seems expected if the module order is

[INFO] Reactor Build Order:
[INFO] 
[INFO] module1
[INFO] module2
[INFO] aggregator