Improved Jenkinsfile example.
node {
stage ('Checkout') {
- git branch:'3.0', url: 'file:////Users/hafner/Development/git/analysis-suite-3.0/analysis-core-plugin'
+ git branch:'master', url: 'git@github.com:jenkinsci/analysis-model.git'
}
stage ('Build') {
def mvnHome = tool 'mvn-default'
- sh "${mvnHome}/bin/mvn --batch-mode -V -U -e clean test -Dsurefire.useFile=false -Dmaven.test.failure.ignore=true"
+ sh "${mvnHome}/bin/mvn --batch-mode -V -U -e clean verify -Dsurefire.useFile=false -Dmaven.test.failure.ignore"
junit testResults: '**/target/surefire-reports/TEST-*.xml'
def java = scanForIssues tool: [$class: 'Java']
def javadoc = scanForIssues tool: [$class: 'JavaDoc']
- publishIssues issues:[java], useStableBuildAsReference: true, id:'java'
- publishIssues issues:[javadoc], useStableBuildAsReference: true, id:'javadoc'
+ publishIssues issues:[java,javadoc], unstableTotalAll:1
}
stage ('Analysis') {
def mvnHome = tool 'mvn-default'
- sh "${mvnHome}/bin/mvn -batch-mode -V -U -e checkstyle:checkstyle pmd:pmd findbugs:findbugs"
+ 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], useStableBuildAsReference: true, id:'checkstyle'
+ publishIssues issues:[checkstyle], unstableTotalAll:1
def pmd = scanForIssues tool: [$class: 'Pmd'], pattern: '**/target/pmd.xml'
- publishIssues issues:[pmd], useStableBuildAsReference: true, id:'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], useStableBuildAsReference: true, id:'findbugs'
+ publishIssues issues:[findbugs], unstableTotalAll:1
+
+ def spotbugs = scanForIssues tool: [$class: 'SpotBugs'], pattern: '**/target/spotbugsXml.xml'
+ publishIssues issues:[spotbugs], unstableTotalAll:1
def maven = scanForIssues tool: [$class: 'MavenConsole']
publishIssues issues:[maven]
