forked from abhijithvg/simple-java-maven-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
39 lines (37 loc) · 931 Bytes
/
Jenkinsfile
File metadata and controls
39 lines (37 loc) · 931 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
pipeline {
agent any
tools {
//To specify the maven to use
maven "mvn3.9.8"
}
stages {
stage('Checkout'){
steps{
//Checkout the source repo from scm
git 'https://github.com/abhijithvg/simple-java-maven-app.git'
}
}
stage('Build'){
steps{
//Use maven to build the project
sh 'mvn clean package'
}
}
stage('Test'){
steps{
//Run tests if applicable
sh 'mvn test'
}
}
}
post{
success{
//This will be executed if the pipeline execution is successful
echo 'Pipeline executed successfully!'
}
failure{
//This will be executed if the pipeline execution fails
echo 'Pipeline failed!'
}
}
}