Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 25 Next »

Version Information









Description / Features

This plugin enables the analysis of Groovy projects. To do so, it leverages Squid to calculate basic metrics, CodeNarc for coding rules violations and Gmetrics for cyclomatic complexity.


Place the JAR file of the plugin in /extensions/plugins of your Sonar installation. Restart sonar.


Maven projects

If you project is built with Maven, you should add in your pom

to the build section and :

Non-maven projects

If you project does not use Maven as a build engine, you should create a small pom.xml file at the root of you project and have the following content in it :

Running analysis

To kick-off the analysis, run mvn sonar:sonar

Advanced usage

It is possible to reuse some reports already existing for GMetrics and CodeNarc. To do so, use sonar.groovy.gmetrics.reportPath or sonar.groovy.codenarc.reportPath.

Known limitations

  • When running the search for duplications, the Groovy lexer will sometimes output some exceptions. It does not stop the Sonar plugin to work, but the will not run comprehensive copy/paste detection on those files. This issue should be fixed in Groovy 1.7. See SONARPLUGINS-596.
  • 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.
  • Inner classes are not processed in the current version and will therefore not be reported. See SONARPLUGINS-597.



Release 0.1 (4 issues)

  • No labels