Create Jenkinsfile

Signed-off-by: WANGZE-ZYHT <1852788395@qq.com>
This commit is contained in:
WANGZE-ZYHT 2025-04-29 08:54:48 +08:00 committed by GitHub
parent 0c88f916db
commit 5cabac71ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

24
Jenkinsfile vendored Normal file
View file

@ -0,0 +1,24 @@
pipeline {
agent any // 使用任意可用节点
tools {
maven 'Maven 3.8.6' // 对应 Jenkins 中配置的 Maven 名称
jdk 'JDK 11' // 对应 Jenkins 中配置的 JDK 名称
}
stages {
stage('Checkout') {
steps {
git url: 'https://github.com/spring-projects/spring-petclinic.git', branch: 'main'
}
}
stage('Build') {
steps {
sh 'mvn clean package -DskipTests' // 跳过测试(仅演示打包)
}
}
stage('Archive') {
steps {
archiveArtifacts artifacts: 'target/*.jar', fingerprint: true
}
}
}
}