forked from tahararib/maven-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsFile3
More file actions
54 lines (50 loc) · 1.41 KB
/
JenkinsFile3
File metadata and controls
54 lines (50 loc) · 1.41 KB
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
pipeline {
agent any // any agent aviable (dispo) to execute the job
tools {
maven 'localMaven'
}
stages {
stage('Clone CodeBase') {
steps {
echo 'Clone gitHub repos'
git 'https://github.com/tahararib/maven-project.git'
}
}
stage('Compile'){
steps {
withMaven(maven:'localMaven')
{
//sh "mvn compile"
bat "mvn compile"
}
}
}
stage('Test'){
steps {
withMaven(maven:'localMaven')
{
//sh "mvn test"
bat "mvn test"
}
}
}
stage('Build'){
steps {
withMaven(maven:'localMaven')
{
//sh "mvn -B -DskipTests clean package"
bat "mvn -B -DskipTests clean package"
}
}
}
stage('Build and send Results to Sonar'){
steps {
withSonarQubeEnv(installationName:'localSonar' , credentialsId: 'token4sonar')
{
//sh "mvn -B -DskipTests clean package sonar:sonar"
bat "mvn -B -DskipTests clean package sonar:sonar"
}
}
}
}
}