mvn2
A Ruby script that runs a maven build, including (or not including) tests, and only outputs the lines that come after a compile failure, build success, test result, or reactor summary start line
Installation
Install it yourself as:
$ gem install mvn2
Usage
Version 2.0.0 introduces a plugin system. Other gems can add plugins to mvn2. The files have to match the pattern mvn2/plugin/*.plugin.rb in your gem's lib/ folder. If you do that, when the gem is installed, mvn2 will automatically pick up on it and load it.
Please see the plugin folder in this gem for examples of how to use the plugin system. My colorconfig and mvn2-say gems also have plugins for mvn2
###optional parameters:
-
-tor--timerto display a timer while the build is in progress (default is display nothing) -
-sor--skip-teststo skip tests (default is running tests) -
-nor--no-stickyto make the growl notification non-sticky (default is sticky) -
-aor--display-allto display all output (default is to only display the output after a compile failure, build success, test result, or reactor summary start line) -
-kor--track-averageto update the average (stored inavg.txt) and also display a progress bar while the build is in progress (default is not to do track average or display progress bar) -
-uor--track-full-averageto update the average list (stored inavg-skip.txtoravg-test.txt) and also display a progress bar while the build is in progress (default is to not do track average or display progress bar) (including this option will cause the progress bar to use the average calculated from the average list if available, but if-kor--track-averageis specified,avg.txtwill still be updated) -
-cor--coloredto display some colors in the timer/progress message -
--write-logto write all of the output to a log file (default is to not write to a log file) -
--log-file NAMEto set the log file name toNAME(default isbuild.log) -
-dor--advanced-averageto use k-means (with minimum optimal k) to find a list of averages and use the closest one for the progress bar and displayed average (default is to use overall average) -
--command-override CMDto override the maven command (disables average tracking options and skip test option) (default isclean install(with optional-D skipTests) and not disabling any options) -
-por--packageto runmvn clean package(with optional-D skipTests) (default ismvn clean install(with optional-D skipTests) (supports average tracking) -
-hor--hide-betweento hide the output between the end of test results (the line starting with "Tests run:") and the next trigger line -
-wor--show-averageto show the average(s) before and after the build (average tracking must be enabled) (default is to not show averages) -
-bor--block-updateto block the average feature from updating the file(s) -
-vor--override-colorsto override the colors with the ones configured by thecolorconfigscript -
-jor--show-projectsto show theBuilding <project>lines when outputting -
--run-before CMDto runCMDbefore calling the maven build -
--run-after CMDto runCMDafter finishing the maven build -
--run-success CMDto runCMDafter finishing a successful maven build -
--run-failure CMDto runCMDafter finishing an unsuccessful maven build -
-eor--exceptionto add the-e -Xoptions to themvncall -
-0or--live-printto print filtered lines as they are outputted by maven -
-1or--set-defaultsto set the defaults so you can just runmvn2without any parameters
###displays: a Growl notification indicating success or failure
##Plugin System
The following is my initial documentation of the plugin system. It may be improved as I have time.
Version 2.0.0 introduces a plugin system. Other gems can add plugins to mvn2. The files have to match the pattern mvn2/plugin/*.plugin.rb in your gem's lib/ folder. If you do that, when the gem is installed, mvn2 will automatically pick up on it and load it.
Two examples of this are my gems colorconfig (https://rubygems.org/gems/colorconfig) and mvn2-say (https://rubygems.org/gems/mvn2-say).
Please see my everyday-plugins (https://github.com/henderea/everyday-plugins) gem for more info on plugins.
If you come up with a plugin, feel free to publish it on your own (that's what the plugin system is designed to support). If you think it should be part of the built-in plugin set, you can always file a pull request.
Contributing
- Fork it ( http://github.com/henderea/mvn2/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request