How to publish Codenarc report for Gradle project in Jenkins

If you are trying to generate Codenarc reports for Gradle Groovy project and publish them in Jenkins then you would require the following configuration:


apply plugin: 'codenarc'
dependencies {
    codenarc 'org.codenarc:CodeNarc:0.21'
codenarc {
    configFile = file('config/codenarc/codenarc.groovy')
    // sourceSets = [project.sourceSets.main] // run codenarc on production sources only
    ignoreFailures = true // Let the build finish even though there are code warnings
    reportFormat = 'xml'
    reportsDir = new File("build/reports/codenarc")


// Read and choose rules here: 
ruleset {

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s