Added by Freddy Mallet, last edited by Antonio Muñiz on Jan 11, 2010  (view change)

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
Name
Sonar PDF Plugin
Authors
Antonio Manuel Muñiz at GMV (http://www.gmv.com) (From version 0.1 to 0.3)
Antonio Manuel Muñiz (blog) at klicap - ingeniería del puzle (http://www.klicap.es) (since 1.0)
Issues
http://jira.codehaus.org/browse/SONARPLUGINS/component/13739
Last Version
1.0
License
LGPL v3
Download sources
http://svn.klicap.es/repos/sonarpdfplugin/trunk
Download binary
http://trac.klicap.es/projects/sonar-pdf-plugin

Compatibility with Sonar

Plugin version Sonar version
0.1 1.8
0.2 1.9
0.3 1.10+
1.0 1.11

Description / Features

Sonar PDF plugin allows to generate a report in PDF format that contains the most relevant information showed by Sonar web interface. The report aims to be a deliverable as part of project documentation.
Actually the report contains:

  • Global dashboard (similar to Sonar web interface dashboard)
  • Violations by categories
  • Hotspots:
    • Most violated rules
    • Most violated files
    • Most complex classes
    • Most duplicated files
  • Dashboard, violations and hotspots for all child modules (if they exists)

You can download an example of report here.

Usage

As Maven Plugin

First analyze your project in sonar. Then run the generate goal (report will be created in the target directory):

 mvn org.codehaus.sonar-plugins:pdf-report:1.0:generate

Available properties (-Dproperty=value)

  • sonar.host.url: sonar server URL (i.e http://my-host:9000/sonar)
  • sonar.branch (-Dbranch is also supported): report on a project branch
  • report.type: select a report type. Values:
    • -Dreport.type=executive
    • -Dreport.type=workbook (default)

If your Sonar server URL is http://localhost:9000 you don't need to specify sonar.host.url.

As Sonar Plugin (post-job)

 
Sonar PDF can be used as a plugin of sonar modeling a post-job work. In this way, a PDF report is generated after each analysis in Sonar (mvn sonar:sonar includes the generation of report).
 
How to install Sonar PDF in Sonar
The installation process is the standard process to install any plugin in Sonar:

  • Dowload pdf-report-1.0.jar
  • Copy to [sonar-dir]/extensions/plugins
  • Restart Sonar

Configuration

You can skip report generation or select report type (executive or workbook) at top level or project level:


Download the report

PDF report can be downloaded from Sonar GUI:

Changelog

 1.0 Release

  • Sonar 1.11 and 1.12 compatibility
  • PDF report is stored in Sonar database and it can be downloaded from Sonar GUI
  • Property sonar.branch supported (instead of branch)
  • Added configuration options in Sonar GUI for PDF report

 0.3 Release

  • Sonar 1.10.X compatibility
  • More deep information about violations
    • Violation and violated line numbers on most violated rules
    • For each module and parent project (if exists)
  • New Sonar Post-job hook

 0.2 Release

  • Sonar 1.9 compatibility
  • Hotspots info
    • Most violated rules
    • Most violated files
    • Most complex classes
    • Most duplicated files
  • Possibility of use "-Dbranch" parameter
  • Better tendency images

0.1 First release

  • Initial data set
    • Dashboard
    • Categories violations

Known limitations

First compatible version: Sonar 1.8