on-internet
← Community

Gradle tool in Jenkins Declarative Pipeline

Stack Overflow ·

I defined a Jenkins Declarative pipeline to CI/CD my project. I am using gradle as my build tool. However I don't want to use the Gradle Wrapper and check it int the VCS. So I planed on using the jenkins tools functionality as below so that I can update the version number if I need to in future. But it doesn't seem to work. pipeline { agent any tools { gradle "gradle-4.0" } stage("Compile") { steps { sh 'gradle project/build.gradle classes' } } I get the error "script.sh: gradle: not found". I tried to echo PATH and that doesn't contain the path of this autoinstalled gradle tool. Please help.

Comments

Sign in or sign up to comment and upvote.

No comments yet.