forked from devopstrainingblr/Maven-Java-Project
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
54 lines (39 loc) · 1.2 KB
/
Jenkinsfile
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!groovy
node {
currentBuild.result = "SUCCESS"
try {
stage('Checkout'){
checkout scm
}
stage('Compiling'){
sh 'mvn clean install'
}
stage('Sonar') {
//add stage sonar
sh 'mvn sonar:sonar'
}
stage('Checkstyle') {
sh 'mvn checkstyle:checkstyle'
}
stage('PMD') {
sh 'mvn pmd:check'
}
/* stage('mail'){
mail body: 'project build successful',
from: '[email protected]',
replyTo: '[email protected]',
subject: 'project build successful',
to: '[email protected]'
}*/
}
catch (err) {
currentBuild.result = "FAILURE"
/* mail body: "project build error is here: ${env.BUILD_URL}" ,
from: '[email protected]',
replyTo: '[email protected]',
subject: 'project build failed',
to: '[email protected]'
*/
throw err
}
}