Skip to content
정명주(myeongju.jung) edited this page Mar 13, 2018 · 1 revision
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'jacoco'
apply plugin: 'org.sonarqube'

def checkstyleConfigFilePath = "${rootProject.projectDir}/config/checkstyle/checkstyle.xml"
def sonarToken = '??????????????????????'

//noinspection GroovyAssignabilityCheck
checkstyle {
    ignoreFailures = false
    //noinspection GroovyAssignabilityCheck
    configFile = file(checkstyleConfigFilePath)
}

checkstyleMain {
    enabled = true
    source = "src/main/java"
}

checkstyleTest {
    enabled = false
}

tasks.withType(Checkstyle) {
    reports {
        xml.enabled = true
        html.enabled = true
    }
}

//noinspection GroovyAssignabilityCheck
pmd {
    ignoreFailures = false
    pmdTest.enabled = false
}

pmdMain {
    source = "src/main/java"
}

tasks.withType(Pmd) {
    reports {
        xml.enabled = true
        html.enabled = true
    }
}

sonarqube {
    check
    def coverageExclusions = [
        '**/*Configuration.java',
        '**/*Application.java',
        '**/Q**.java']
    //noinspection GroovyAssignabilityCheck
    properties {
        // Sonar Specific properties
        property 'sonar.projectName', projectName // This is the display project name
        property 'sonar.projectKey', projectKey
        property 'sonar.host.url', 'http://sonarqube.domain.com' // This is the Sonar Server
        property 'sonar.login', sonarToken
        property 'sonar.links.scm', "https://github.com/domain/${rootProject.name}"
        property 'sonar.links.ci', "http://ci.domain.com/"
        property 'sonar.coverage.exclusions', coverageExclusions.join(',')
    }
}
Clone this wiki locally