3.2.1、全局工具配置
如果没有该选项,请按照ant插件
3.2.2、设置构建参数
3.2.2、jenkinsfile
#!groovy
String buildShell = "${env.buildShell}" //引用参数
pipeline {
agent {
node {
label "master" //构建主机
}
}
stages {
stage("mvnBuild") {
steps {
script {
mvnHome=tool "m2" //引用工具
sh "${mvnHome}/bin/mvn ${buildShell}" //引用参数变量
}
}
}
stage("antBuild") {
steps {
script {
AntHome=tool "ant" //引用工具
sh "${AntHome}/bin/ant ${buildShell}" //引用参数变量
}
}
}
}
}