I just came into new wave for Jenkinsfile
, that is now allows to do it as Declarative Pipeline.
What should be standard Jenkinsfile
for maven project, e.g. Spring Boot?
This is my Jenkins File for my Maven Project. i.e., Spring Boot as per your requirement. Have a look.
node {
try{
stage 'checkout project'
checkout scm
stage 'check env'
sh "mvn -v"
sh "java -version"
stage 'test'
sh "mvn test"
stage 'package'
sh "mvn package"
stage 'report'
step([$class: 'JUnitResultArchiver', testResults: '**/target/surefire-reports/TEST-*.xml'])
stage 'Artifact'
step([$class: 'ArtifactArchiver', artifacts: '**/target/*.jar', fingerprint: true])
}catch(e){
throw e;
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With