Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The plugin enables analysis of Groovy projects within SonarQubeTM.

It is compatible with the Issues Report plugin to run pre-commit local analysis.It leverages CodeNarc to raise issues against coding rules, Gmetrics for cyclomatic complexity and Cobertura for code coverage.

Plugin

0.1

0.2

0.3

0.4

0.50.61.0

CodeNarc

0.9

0.9

0.13

0.15

0.16.10.170.20

GMetrics

0.2

0.2

0.3

0.3

0.40.5

cobertura-maven-plugin

(error)

2.4

2.5

2.5

2.5.12.5.1

Installation

  1. Install the plugin through the Update Center or download it into the SONARQUBE_HOME/extensions/plugins directory
  2. Restart the SonarQubeTM server
0.6

Include Page
Include - Plugin Installation
Include - Plugin Installation

Usage

Run an Analysis with the SonarQube

...

Runner (Recommended

...

method)

To run an analysis of your Groovy project, use the SonarQube TM Runner.

A sample project is available on github that can be browsed or downloaded: /projects/languages/groovy/groovy-sonar-runner.

...

A Maven sample project is available on github that can be browsed or downloaded/projects/languages/groovy/groovy-maven.

Advanced Usage

Code Coverage

To display code coverage data:

  1. Prior to the SonarQube analysis, execute your unit tests and generate the Cobertura XML report.
  2. Import this report while running the SonarQube analysis by setting the sonar.groovy.cobertura.reportPath property to the path to the Cobertura XML report. The path may be absolute or relative to the project base directory.

A sample project can be browsed or downloaded/projects/languages/groovy/groovy-sonar-runner-cobertura.

CodeNarc

It is possible to reuse a previously generated report from CodeNarc by setting the sonar.groovy.codenarc.reportPath property.

...

See Metrics documentation page.

Known Limitations

The source directory must be added to the pom.xml, even if the project is built with Maven. This comes from the fact that SonarQubeTM does not call gmaven plugin.

Change Log

JIRA Issues
anonymoustrue
titleVersion 0.6
renderModestatic
width900
columnstype;key;summary;priority
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor=18495&pid=11911&sorter/field=issuekey&sorter/order=DESC&tempMax=1000

 

JIRA Issues
anonymoustrue
titleVersion 0.5
renderModestatic
width900
columnstype;key;summary;priority
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?fixfor=18225&pid=11911&sorter/field=issuekey&sorter/order=DESC&tempMax=1000

 

...

Release Notes

Version 1.0

It is no longer possible to:

  • Let SonarQube drive the execution of unit tests.
  • Import unit test execution reports (feel free to vote for 
    JIRA
    serverjira.codehaus.org
    keySONARPLUGINS-3540
     to reintroduce this feature).
  • Let SonarQube drive the execution of Cobertura; it is now only possible to import previously generated Cobertura report.