Monday, February 18, 2013

Create Aggregatable Maven Report Plugin

There are some good examples, like this and this, however they all use javadoc style and didn't include the complete pom file, nor include aggregator.

The packaging maven-plugin is to instruct maven that it is a maven plugin and thus will look for the plugin.xml in META-INF.  The maven-plugin-plugin in the build is to generate the plugin.xml.  since I am using java annotation, we'll have to add maven-plugin-annotations to the dependencies.
Then I want to build a custom report so that it will generate the aggregated version only if the project has modules (to aggregated the reports of all its modules) and the normal report when the report has no modules. to do that, annotate MavenProject with @Component and the current project will be injected. Override the canGenerateReport so that either the aggregated version or the normal version will be generated.

the reactor projects is to get the module projects for aggregated as MavenProject.getModules only return the name of the module.
Finally to add that to your site report

1 comment:

  1. This will not trigger a large downside though, because the cell website greater than makes up for this. If a Spin Casino app is launched sooner or later, you’ll find out here first. Depositing cash at Spin Casino is straightforward - just head to the banking part and observe the simple directions. You can use many various depositing 1xbet choices, includingVisa, Mastercard, PayPal, Skrill, Neteller and paysafecard. All these choices let you deposit cash into your Spin Casino account instantly. There are 15 completely different progressive jackpot slots at Spin Casino, which is a really impressive quantity.