A custom Dashboard configuration xml file can be defined and then referenced via a URL, File, or build classpath resource reference.
To reference a custom Dashboard configuration, use the configLocation parameter.
<project> [...] <build> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>dashboard-maven-plugin</artifactId> <version>1.0-SNAPSHOT</version> <configuration> <dialect> org.hibernate.dialect.DerbyDialect </dialect> <driverClass> org.apache.derby.jdbc.ClientDriver </driverClass> <connectionUrl> jdbc:derby://localhost:1527/myDB;create=true </connectionUrl> <username>usr</username> <password>usr</password> <configLocation>myDashboardConfig.xml</configLocation> </configuration> <dependencies> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derbyclient</artifactId> <version>10.2.1.6</version> </dependency> </dependencies> </plugin> </plugins> </build> [...] </project>
This example causes the Maven 2 Dashboard plugin to check for a File named myDashboardConfig.xml or a resource named myDashboardConfig.xml within the compile scope of the dependencies or build extensions classpath.
At this time, you can only add or delete <graph> elements in your custom configuration file.
For this example, we will delete the 2 existing graphs and add 3 new graphs in the "Checkstyle" section
See the default configuration :
[...] <section id="checkstyle.summary" title="Checkstyle Report Summary" groupId="org.apache.maven.plugins" artifactId="maven-checkstyle-plugin"> <historicgraphs> <graph id="checkstyle.currentweek" title="Checkstyle current Week" timeUnit="day" startPeriod="Startof_thisweek" endPeriod="Endof_thisweek" /> <graph id="checkstyle.previousweek" title="Checkstyle previous Week" timeUnit="day" startPeriod="Startof_lastweek" endPeriod="Endof_lastweek" /> </historicgraphs> </section> [...]
See the new configuration :
[...] <section id="checkstyle.summary" title="Checkstyle Report Summary" groupId="org.apache.maven.plugins" artifactId="maven-checkstyle-plugin"> <historicgraphs> <graph id="checkstyle.currenttwoweek" title="Checkstyle current two Weeks" timeUnit="day" startPeriod="Startof_lastweek" endPeriod="Endof_thisweek" /> <graph id="checkstyle.currentmonth" title="Checkstyle current Month" timeUnit="day" startPeriod="Startof_thismonth" endPeriod="Endof_thismonth" /> <graph id="checkstyle.currentmonth" title="Checkstyle current Month" timeUnit="day" startPeriod="Startof_lastmonth" endPeriod="Endof_lastmonth" /> </historicgraphs> </section> [...]