The Dashboard plugin aggregates report data from multiple Maven reports over multiple projects using the reactor. To understand the work of the plugin better we have to look at the following topics
The aggregation runs over the existing Maven reports but how to get them?! Either the Dashboard plugin is told to collect data from existing reports (but you have to make sure that all reports exists) or it runs the required plugins itself (which hurts the build time)
This behaviour is controlled by
maven.dashboard.rungoals = [true|false]
If this property is set to "true" the Dashboard plugin looks at the value of 'maven.dashboard.aggregators' to determine which plugins to run automatically. When running those plugins the configuration of the started plugins are modified dynamically, e.g. for the Clover plugin the XML report generation is enabled.
The aggregation for the master project is a two-step process triggered by the reactor
The result of the aggregation is a file 'dashboard-single.xml' which could look like the following example collecting data of JUnit, Clover, PMD, CVS and Checkstyle reports
<?xml version="1.0" encoding="UTF-8"?> <dashboard-single> <aggregator name="junitpassrate">100 %</aggregator> <aggregator name="clovertpc">54%</aggregator> <aggregator name="cloverloc">2844</aggregator> <aggregator name="pmdviolations">0</aggregator> <aggregator name="scmchangedfiles">5</aggregator> <aggregator name="cserrors">27</aggregator> </dashboard-single>
It is now time to collect the aggregated data for all subprojects which results into a 'dashboard-data.xml'. This file is then transformed to the Dashoard HTML report.
<?xml version="1.0" encoding="UTF-8"?> <dashboard> <project name="it20one-service-framework"> <aggregator name="junitpassrate">100 %</aggregator> <aggregator name="clovertpc">54%</aggregator> <aggregator name="cloverloc">2844</aggregator> <aggregator name="pmdviolations">0</aggregator> <aggregator name="scmchangedfiles">5</aggregator> <aggregator name="cserrors">27</aggregator> </project> ... <project name="it20one-digistamp-service"> <aggregator name="junitpassrate">-</aggregator> <aggregator name="clovertpc">-</aggregator> <aggregator name="cloverloc">-</aggregator> <aggregator name="pmdviolations">7</aggregator> <aggregator name="scmchangedfiles">2</aggregator> <aggregator name="cserrors">121</aggregator> </project> </dashboard>