Hudson + Grails + CodeNarc -> Groovy Style Check

Today I am going to search for plug-ins for Hudson to analyse the quality of groovy code checked-into the repository. The build and test run processes are set up already and the code coverage reports are being generated. It is the time to start running static code analysis and monitor the code quality.

I have searched on-line and for the moment the only tool that I see being used for checking groovy code is CodeNarc, there are no CodeNarc plugins for Hudson though.

Luckily I have experience using Hudson Violations plug-in, so if I could give the html produced by CodeNarc as an input to Violations plug-in that would work.

So In order to start checking the Groovy Code the following steps need to be taken:

  1. Add the CodeNarc Grails plugin into your project

    grails install-plugin codenarc

  2. Put the configurations for CodeNarc into config.groovy.

    codenarc { reportName = ‘target/test-reports/CodeNarcReport.xml’
    reportType = ‘xml’
    // any further settings like maxPriority1Violations=0 }

  3. Configure your Hudson project job to execute CodeNarc during the buildcodenarc hudson config
  4. Install the Hudson Violations plugin

  5. Go to the Project root in Hudson and enjoy the graph & elaborate on the details!

IMPORTANT: Please note that Violations plug-in version 0.7.7 + is required, since the previous versions do not have support for codenarc.

This entry was posted in checkstyle, configuration, continuous integration, dynamic languages, groovy, hudson, programming style. Bookmark the permalink.

One Response to Hudson + Grails + CodeNarc -> Groovy Style Check

  1. Pingback: Narek Alaverdyan

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>