Gradle Wrapper in Jenkins/Groovie Pipeline


(Roger Goud) #1

Hi list,
I am trying to use gradle…wrapper in Groovie pipeline in Jenkins, what is the way of using gradle.wrapper in Groovie Pipeline in Jenkins?

Thanks in Advance
Roger


(Stefan Wolf) #2

Hi Roger,

I guess for declarative pipeline something like this would work:

pipeline {
    agent any
    tools {
        jdk 'jdk8' 
    }
    stages {
        stage('Example') {
            steps {
                sh './gradlew build'
            }
        }
    }
}

That means running the gradle wrapper as a simple shell script. Does that work for you?

Cheers,
Stefan