Answers for "how to maven as tool in jenkins pipeline"

0

how to maven as tool in jenkins pipeline

pipeline {
    agent any
    tools { (1)
        maven 'Maven 3.3.9' (2)
        jdk 'jdk8' (3)
    }
    stages {
        stage ('Initialize') {
            steps {
                sh '''
                    echo "PATH = ${PATH}"
                    echo "M2_HOME = ${M2_HOME}"
                ''' (4)
            }
        }

        stage ('Build') {
            steps {
                echo 'This is a minimal pipeline.'
            }
        }
    }
}
Posted by: Guest on May-13-2021

Code answers related to "how to maven as tool in jenkins pipeline"

Browse Popular Code Answers by Language