forked from jenkinsci/analysis-model
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile.declarative
32 lines (30 loc) · 1.33 KB
/
Jenkinsfile.declarative
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
pipeline {
agent 'any'
tools {
maven 'mvn-default'
jdk 'jdk-default'
}
stages {
stage ('Build') {
steps {
sh '${M2_HOME}/bin/mvn --batch-mode -V -U -e clean verify -Dsurefire.useFile=false -Dmaven.test.failure.ignore'
}
}
stage ('Analysis') {
steps {
sh '${M2_HOME}/bin/mvn --batch-mode -V -U -e checkstyle:checkstyle pmd:pmd pmd:cpd findbugs:findbugs spotbugs:spotbugs'
}
}
}
post {
always {
junit testResults: '**/target/surefire-reports/TEST-*.xml'
recordIssues enabledForFailure: true, tools: [[pattern: '', tool: [$class: 'MavenConsole']], [pattern: '', tool: [$class: 'Java']], [pattern: '', tool: [$class: 'JavaDoc']]]
recordIssues enabledForFailure: true, tools: [[pattern: '', tool: [$class: 'CheckStyle']]]
recordIssues enabledForFailure: true, tools: [[pattern: '', tool: [$class: 'FindBugs']]]
recordIssues enabledForFailure: true, tools: [[pattern: '', tool: [$class: 'SpotBugs']]]
recordIssues enabledForFailure: true, tools: [[pattern: '**/target/cpd.xml', tool: [$class: 'Cpd']]]
recordIssues enabledForFailure: true, tools: [[pattern: '**/target/pmd.xml', tool: [$class: 'Pmd']]]
}
}
}