spring-petclinic/Jenkinsfile

51 lines
1.6 KiB
Text
Raw Normal View History

2025-03-25 19:11:30 +00:00
pipeline {
2025-03-27 18:21:55 +00:00
agent any
tools {
maven 'maven-3'
2025-03-25 23:59:54 +00:00
}
2025-03-27 18:21:55 +00:00
environment {
JFROG_URL = "https://trialt0zppb.jfrog.io/artifactory"
JFROG_REPO_RELEASES = "petclinic-maven-dev-local"
JFROG_REPO_SNAPSHOTS = "petclinic-maven-dev-virtual"
JFROG_CREDENTIALS_ID = 'jfrog-saas'
JFROG_CLI_BUILD_NAME = "spring-petclinic"
JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}"
2025-03-25 19:11:30 +00:00
}
2025-03-27 18:21:55 +00:00
stages {
stage('Build Maven') {
steps {
script {
// Using JFrog plugin to capture build info
artifactory.upload spec: """{
"files": [
{
"pattern": "target/*.jar",
"target": "${JFROG_REPO_RELEASES}/"
}
]
}"""
// Run Maven Build
sh 'mvn clean deploy -DskipTests -Dcheckstyle.skip=true'
}
}
}
stage('Publish Build Info') {
steps {
script {
// Publish build information to JFrog Artifactory
def buildInfo = Artifactory.newBuildInfo()
buildInfo.name = "${JFROG_CLI_BUILD_NAME}"
buildInfo.number = "${JFROG_CLI_BUILD_NUMBER}"
Artifactory.publishBuildInfo(buildInfo)
}
}
}
2025-03-25 19:11:30 +00:00
}
2025-03-27 18:21:55 +00:00
post {
always {
echo "Build complete: ${env.JFROG_CLI_BUILD_NAME} #${env.BUILD_NUMBER}"
}
2025-03-25 23:48:12 +00:00
}
2025-03-27 18:21:55 +00:00
}