3.4.1、按照插件
https://mirrors.tuna.tsinghua.edu.cn/jenkins/plugins/gradle/latest/

3.4.2、配置jenkins


3.4.2、编写jenkinsfile
#!groovyString 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 {try{ //防止异常终止执行AntHome=tool "ant" //引用工具sh "${AntHome}/bin/ant ${buildShell}" //引用参数变量} catch(e){println(e)}}}}stage("npmBuild") {steps {script {NpmHome=tool "NPM" //引用工具sh "${NpmHome}/bin/npm ${buildShell}" //引用参数变量}}}stage("gradleBuild") {steps {script {NpmHome=tool "Gradle" //引用工具sh "${NpmHome}/bin/gradle ${buildShell}" //引用参数变量}}}}}

