forked from rchidana/JacocoExample
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile_02
More file actions
44 lines (35 loc) · 952 Bytes
/
Jenkinsfile_02
File metadata and controls
44 lines (35 loc) · 952 Bytes
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
#!groovy
pipeline {
environment {
JAVA_TOOL_OPTIONS = "-Duser.home=/var/maven"
}
agent {
docker {
image "maven:3.8.5-jdk-8"
args "-u root -v /tmp/maven:/var/maven/.m2 -e MAVEN_CONFIG=/var/maven/.m2"
}
}
stages {
//this_stage_config_builds(war file) and test
stage("Build") {
steps {
sh "mvn -version"
sh "mvn clean install -X"
}
}
//this_stage_config_brings_in_the_jacoco_metrics
stage ('JaCoCo') {
steps {
jacoco(execPattern: 'target/jacoco.exec')
}
}
//this_stage_covers_the code coverage
stage('SonarQube analysis') {
steps{
withSonarQubeEnv('Sonar-Qube') {
sh "mvn sonar:sonar"
}
}
}
}
}