-
Notifications
You must be signed in to change notification settings - Fork 64
Expand file tree
/
Copy pathJenkinsfile
More file actions
52 lines (46 loc) · 1 KB
/
Copy pathJenkinsfile
File metadata and controls
52 lines (46 loc) · 1 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
pipeline {
agent any
tools {
// Define tool name and version
maven 'Maven3'
jdk 'JDK8'
}
stages {
stage('Checkout') {
steps {
// Checkout the code from the SCM
checkout scm
}
}
stage('Build') {
steps {
// Build the code using Maven
sh 'mvn clean install -DskipTests'
}
}
stage('Archive') {
steps {
// Archive the build artifacts
arctifacts: '**/target/*.jar', allowEmptyArchive: true
}
}
stage('Test') {
steps {
// Run the unit tests
sh 'mvn test'
}
}
}
post {
always {
// Cleanup after the build
deleteDir()
}
success {
echo 'Build was successful!'
}
failure {
echo 'Blded!'
}
}
}