jenmkinsfile

This commit is contained in:
Jesse Houldsworth 2025-03-27 11:31:53 -07:00
parent 3a321133af
commit 8d83725287

25
Jenkinsfile vendored
View file

@ -15,8 +15,13 @@ pipeline {
stage('Build Maven') { stage('Build Maven') {
steps { steps {
script { script {
// Using JFrog plugin to capture build info def server = Artifactory.server(env.JFROG_CREDENTIALS_ID)
artifactory.upload spec: """{
// Run Maven Build
sh 'mvn clean install -DskipTests -Dcheckstyle.skip=true'
// Upload artifacts to Artifactory
server.upload spec: """{
"files": [ "files": [
{ {
"pattern": "target/*.jar", "pattern": "target/*.jar",
@ -24,21 +29,19 @@ pipeline {
} }
] ]
}""" }"""
// Run Maven Build
sh 'mvn clean deploy -DskipTests -Dcheckstyle.skip=true'
} }
} }
} }
stage('Publish Build Info') { stage('Publish Build Info') {
steps { steps {
script { script {
// Publish build information to JFrog Artifactory def server = Artifactory.server(env.JFROG_CREDENTIALS_ID)
def buildInfo = Artifactory.newBuildInfo() def buildInfo = Artifactory.newBuildInfo()
buildInfo.name = "${JFROG_CLI_BUILD_NAME}" buildInfo.name = env.JFROG_CLI_BUILD_NAME
buildInfo.number = "${JFROG_CLI_BUILD_NUMBER}" buildInfo.number = env.JFROG_CLI_BUILD_NUMBER
Artifactory.publishBuildInfo(buildInfo) server.publishBuildInfo(buildInfo)
} }
} }
} }
@ -48,4 +51,4 @@ pipeline {
echo "Build complete: ${env.JFROG_CLI_BUILD_NAME} #${env.BUILD_NUMBER}" echo "Build complete: ${env.JFROG_CLI_BUILD_NAME} #${env.BUILD_NUMBER}"
} }
} }
} }