added jenkinfile

This commit is contained in:
Anuraag8125 2025-04-01 11:41:14 +05:30
parent 98a7101c04
commit f3d3a1f33a

34
jenkinfile Normal file
View file

@ -0,0 +1,34 @@
pipeline {
agent any
tools {
maven 'Maven' // Ensure Maven is installed in Jenkins
}
stages {
stage('Clone the project') {
steps {
git branch: 'main', url: 'https://github.com/pranavi-23/spring-petclinic.git'
}
}
stage('Build the project') {
steps {
sh 'mvn clean install'
}
}
stage('Test') {
steps {
sh 'mvn test'
}
}
stage('Publish the Test results') {
steps {
junit 'target/surefire-reports/*.xml'
}
}
stage('Publish the artifacts results') {
steps {
archiveArtifacts artifacts: 'target/*.jar', followSymlinks: false
}
}
}
}