Jenkins Declarative Pipeline

Sample Jenkins Declarative Pipeline def A = false def B = true pipeline { agent any tools { maven 'MVN' jdk 'JDK' } stages { stage('Build Stage') { steps { git "https://github.com/nishantautomationlabs/nal-junitmockito.git" sh "mvn -U clean compile install -DskipTests" echo 'Build Stage executed' } } stage('Unit Test Stage') { steps { sh "mvn -Dtest=MockitoExampleTest test" echo 'Unit Test Stage executed' } } stage('Master Stage'){ when{ branch 'master' } steps { echo 'run this stage only if its running on the master branch' } } stage('Conditional Stage') { when { ...