timgifford / maven-buildtime-extension Goto Github PK
View Code? Open in Web Editor NEWA Maven build time extension that displays the duration for each goal that is run during your build
License: MIT License
A Maven build time extension that displays the duration for each goal that is run during your build
License: MIT License
Uses the default from the release plugin.
[maven-release-plugin] copy for tag maven-buildtime-extension-2.0
Tag: 2.0
Message: [maven-release-plugin] Release 2.0
Would it be possible to add yet another summary - cumulative, per plugin statistic? Currently, your extension output more detailed times for each module. It would be great to have "totals" section, where times for each plugin for each module would be summed / accumulated (to have overview which plugin impacts the build the most in total)
The MojoTimer assumes that there is never a name over 57 characters since it does not check to ensure calculateLineLength() will not return a negative number.
It would be nice if the output length was also configurable or something higher than 68 characters.
Only the commandline argument "-Dbuildtime.output.log" activates the report during normal runs.
The maven property <buildtime.output.log>true</buildtime.output.log> does not do anything. Is this intended?
Jenkins injects its own ExecutionListener
to extract information about the build. Since MavenExecutionRequest
supports only one ExecutionListener
it is currently overwritten by ExecutionTimingExecutionListener.
We could either use a delegating pattern similar to
https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/eventspy/internal/EventSpyExecutionListener.java or directly use the EventSpy mechanism https://github.com/apache/maven/blob/master/maven-core/src/main/java/org/apache/maven/eventspy/AbstractEventSpy.java
From what I've seen extending AbstractEventSpy is the right way to go.
I don't see the plugin timings like in the README.md example.
I'm doing a reactor build, and I see the time it took each project. No plugin-level timings.
maven.config
-Dbuildtime.output.log=true
extensions.xml
<extensions>
<extension>
<groupId>co.leantechniques</groupId>
<artifactId>maven-buildtime-extension</artifactId>
<version>3.0.3</version>
</extension>
</extensions>
It would be great if you could add an option to redirect the output to a file.
Maybe even in a simple csv format "Module";"Mojo";"Time"
or something like that,
so that it can be analyzed easier.
Could you add some ability to sort desceding goals by spended time?
I have a very big project and want to see most problematic items but now i need to expost data to CSV and then sort them in Excel.
For me looks that this feature will be useful.
-Dbuildtime.output.csv=true -Dbuildtime.output.csv.file=output.csv
Instead of -Dbuildtime.output.csv.file=output.csv
provide the absolute path like -Dbuildtime.output.csv.file=/Users/joseph/my_project/output.csv
Create target directory, but ensure that your mvn command does not run clean phase.
[ERROR] Could not write report
java.io.FileNotFoundException: target/output.csv (No such file or directory)
at java.io.FileOutputStream.open0 (Native Method)
at java.io.FileOutputStream.open (FileOutputStream.java:270)
at java.io.FileOutputStream.<init> (FileOutputStream.java:213)
at java.io.FileOutputStream.<init> (FileOutputStream.java:162)
at java.io.PrintWriter.<init> (PrintWriter.java:263)
at co.leantechniques.maven.buildtime.output.CsvReporter.performReport (CsvReporter.java:39)
at org.apache.maven.cli.BuildTimeEventSpy.doReport (BuildTimeEventSpy.java:81)
at org.apache.maven.cli.BuildTimeEventSpy.onEvent (BuildTimeEventSpy.java:65)
at org.apache.maven.cli.BuildTimeEventSpy.onEvent (BuildTimeEventSpy.java:46)
at org.apache.maven.eventspy.internal.EventSpyDispatcher.onEvent (EventSpyDispatcher.java:104)
at org.apache.maven.eventspy.internal.EventSpyExecutionListener.sessionEnded (EventSpyExecutionListener.java:61)
at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:64)
at org.apache.maven.lifecycle.internal.DefaultExecutionEventCatapult.fire (DefaultExecutionEventCatapult.java:42)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:137)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Need to provide guidance for contributing to the project.
Since we now have some rather useful unit and integration tests, I would suggest adding https://travis-ci.org/ so that PRs are automatically checked. See https://docs.travis-ci.com/user/getting-started
See if we can use the information here to make the release process more automated.
#8 mentions the "spam" problem with all the timing output at the end of a build.
It would be useful to have an option to log the build times only when the build succeeds, so that important failure-related messages aren't pushed off the screen by subsequent build timing information.
We're using your maven-buildtime-extension plugin where I'm working right now - very useful!
One issue we have is that we've a large multi-module build with lots of plugins, so when it reports at the end it spams our screens. Lots of people just want to se 'BUILD SUCCESS' and only a few need to know about all the plugin timings.
Can you add a configuration parameter to allow us to turn off logging, and/or allow us to specify thresholds we might be interested in reporting? Perhaps its also possible to report how long each module takes so we'd only be interested in reporting plugins if the entire module takes more than a certain time...
Right now we're suppressing the entire plugin using a build profile so would be great to have a bit of configuration built in.
Thanks
When a java process is locking a file in the background and I run the build again, the build fails and the extension reports a large negative number (possibly minimum integer value).
[INFO] maven-clean-plugin:clean ................................. [-1389029550.705s]
As the readme says oss-parents have been deprecated.
This should consider making its own parent pom , instead of using oss-parent.
A couple of releases ago, Maven started supporting colorized ansi output, which makes the logs very easy to read. When I use this plugin to profile the times associated with the build (love it!), I lose the colorized output (do not love it).
Running on 3.2.1 produced the following issue. Thanks!
Exception in thread "main" java.lang.NoSuchMethodError: org.apache.maven.executi
on.MavenExecutionRequest.isThreadConfigurationPresent()Z
at org.apache.maven.cli.ExecutionEventLogger.logStats(ExecutionEventLogg
er.java:205)
Usage section indicates new mode to load plugin via <projectroot>/.mvn/extensions.xml
file (https://github.com/timgifford/maven-buildtime-extension#maven-33---use-version-30). This suggests that the extension must be configured for each project. Is there a way to actually enable/configure it in parent pom.xml file so that child projects would use it immediatelly?
When the Maven build is part of a Jenkins job and a timeout occurs, no report is written.
Having the report could help to understand why the built lasted for so long.
It would be great if the extension could try to write the information already available, even though the JVM is forcibly shutting down.
This probably means relying on java.lang.Runtime.addShutdownHook(Thread)
, i.e. this is on a best effort basis.
In case the build is successful, then there is no need to write the same report twice.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.