jenkins-hello-world-pub/Jenkinsfile

32 lines
555 B
Text
Raw Normal View History

2025-12-13 16:32:47 +00:00
pipeline {
2025-12-15 01:47:54 +08:00
agent any
stages {
stage('Echo Version') {
steps {
sh 'echo Print Maven Version'
sh 'mvn -version '
}
}
2025-12-13 16:32:47 +00:00
2025-12-15 01:47:54 +08:00
stage('Build') {
steps {
sh 'mvn clean package -DskipTests=true'
archiveArtifacts 'target/hello-demo-*.jar'
}
2025-12-13 16:32:47 +00:00
}
2025-12-15 01:47:54 +08:00
stage('Unit Test') {
steps {
script {
sh "mvn test"
2025-12-13 16:32:47 +00:00
}
2025-12-13 17:36:11 +00:00
2025-12-15 01:49:59 +08:00
junit(testResults: 'target/surefire-reports/TEST-*.xml', keepProperties: true, keepTestNames: true)
2025-12-15 01:47:54 +08:00
}
2025-12-13 16:32:47 +00:00
}
2025-12-15 01:47:54 +08:00
}
tools {
maven 'M398'
}
}