Added quality gates to Jenkinsfile.
@@ -13,10 +13,7 @@ node {
def java = scanForIssues tool: [$class: 'Java']
def javadoc = scanForIssues tool: [$class: 'JavaDoc']
- publishIssues issues:[java]
- publishIssues issues:[javadoc]
-
- publishIssues id:'compiler', name:'Every Compiler', issues:[java, javadoc], filters:[[property: [$class: 'IncludePackage'], pattern: 'io.jenkins.plugins.analysis*']]
+ publishIssues issues:[java,javadoc], unstableTotalAll:1
}
stage ('Analysis') {
@@ -25,36 +22,31 @@ node {
sh "${mvnHome}/bin/mvn -batch-mode -V -U -e checkstyle:checkstyle pmd:pmd pmd:cpd findbugs:findbugs spotbugs:spotbugs"
def checkstyle = scanForIssues tool: [$class: 'CheckStyle'], pattern: '**/target/checkstyle-result.xml'
- publishIssues issues:[checkstyle]
+ publishIssues issues:[checkstyle], unstableTotalAll:1
def pmd = scanForIssues tool: [$class: 'Pmd'], pattern: '**/target/pmd.xml'
- publishIssues issues:[pmd]
+ publishIssues issues:[pmd], unstableTotalAll:1
def cpd = scanForIssues tool: [$class: 'Cpd'], pattern: '**/target/cpd.xml'
publishIssues issues:[cpd]
def findbugs = scanForIssues tool: [$class: 'FindBugs'], pattern: '**/target/findbugsXml.xml'
- publishIssues issues:[findbugs]
+ publishIssues issues:[findbugs], unstableTotalAll:1
def spotbugs = scanForIssues tool: [$class: 'SpotBugs'], pattern: '**/target/spotbugsXml.xml'
- publishIssues issues:[spotbugs]
+ publishIssues issues:[spotbugs], unstableTotalAll:1
def maven = scanForIssues tool: [$class: 'MavenConsole']
publishIssues issues:[maven]
-
- publishIssues id:'analysis', name:'Every Tool', issues:[checkstyle, pmd, findbugs, spotbugs], filters:[[property: [$class: 'IncludePackage'], pattern: 'io.jenkins.plugins.analysis*']]
}
- stage ('Analysis') {
+ stage ('Mutation Testing') {
def mvnHome = tool 'mvn-default'
- sh "${mvnHome}/bin/mvn --batch-mode -V -U -e checkstyle:checkstyle pmd:pmd pmd:cpd findbugs:findbugs spotbugs:spotbugs"
+ sh "${mvnHome}/bin/mvn -batch-mode -V -U -e compile test-compile org.pitest:pitest-maven:mutationCoverage"
- checkstyle()
- pmd()
- findbugs()
- dry()
- openTasks high: 'FIXME', normal: 'TODO'
+ def pit = scanForIssues tool: [$class: 'Pit'], pattern: '**/mutations.xml'
+ publishIssues issues:[pit]
}
stage ('Coverage') {
@@ -64,12 +56,4 @@ node {
jacoco()
}
-
- stage ('Mutation Testing') {
- def mvnHome = tool 'mvn-default'
-
- sh "${mvnHome}/bin/mvn -batch-mode -V -U -e compile compile-tests org.pitest:pitest-maven:mutationCoverage"
-
-
- }
}
