Wednesday, December 05, 2007

Maven2 Dashboard Plugin

What a trouble to have the maven 2 dashboard plugin working...

I will later tell you my saga on upgrading my project to maven 2, but now I just would like to write down the procedure to have a maven 2 multiproject built with the dashboard plugin.
In the plugin page (this one) it miss some information.

  • 1- Add the repository to your parent pom.xml
As the plugin is a snapshot version, you need to add a pluginRepository section to your parent pom (this can be done at the end of the pom, before the ) :
<pluginRepositories>
<pluginRepository>
<id>Codehaus Snapshots</id>
<url>http://snapshots.repository.codehaus.org/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
  • 2- Insert the report section into the POM
This need to be inserted as the last report into your parent pom.xml

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>dashboard-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
</plugin>


what was missing here in the official page was the version, as it doesn't auto-resolve the version for snapshot releases.

  • 3 - Run the site and the dashboard
This is a two step process. First you need to run the site:

mvn site:site

and this is the catch, when running the dashboard plugin (which aggregates results and regenerates the dashboard html) you need to specify the version. This is not on the usage page as well:

mvn org.codehaus.mojo:dashboard-maven-plugin:1.0-SNAPSHOT:dashboard

If you want to have the aggregate page as in the maven 1 dashboard plugin, you should use:


<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>dashboard-maven-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<configuration>
<m1LikeRendering>true</m1LikeRendering>
</configuration>
</plugin>



After this you might have the snapshot report on your parent page of your site (reports section), the report that follows is the sub-project one. I used the m1LikeRendering property set to true.








One problem though that I couldn't fix: the links from the the aggregate dashboard report doesn't work for all submodules, just got one to work, aparently, if your sub-module name has a '.' it gets clipped when creating the link.

Emerson



0 comments: