{iframe:src=http://update.sonarsource.org/plugins/groovy.html|width=700|height=220|frameborder=0}
Your browser does not support iframes.
{iframe} |
If you want to see a live example of the capabilities of the Groovy plugin, you can have a look at the analysis of the CodeNarc project on Nemo. |
The plugin enables analysis of Groovy projects within Sonar.
It is compatible with the Issues Report plugin to run pre-commit local analysis.
It leverages CodeNarc for coding rules violations, Gmetrics for cyclomatic complexity and Cobertura for code coverage.
Plugin | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 |
|---|---|---|---|---|---|---|
CodeNarc | 0.9 | 0.9 | 0.13 | 0.15 | 0.16.1 | 0.17 |
GMetrics | 0.2 | 0.2 | 0.3 | 0.3 | 0.4 | 0.5 |
cobertura-maven-plugin |
| 2.4 | 2.5 | 2.5 | 2.5.1 | 2.5.1 |
To launch a Sonar analysis of your Groovy project, use the Sonar Runner.
A sample project is available on github that can be browsed or downloaded: /projects/languages/groovy/groovy-sonar-runner.
Maven and Ant can also be used to launch analysis on Groovy projects.
A Maven sample project is available on github that can be browsed or downloaded: /projects/languages/groovy/groovy-maven.
It is possible to reuse previously generated report from CodeNarc by setting the sonar.groovy.codenarc.reportPath property.
See Metrics documentation page.
The source directory must be added to the pom.xml, even if the project is built with Maven. This comes from the fact that Sonar does not call gmaven plugin.