Hi -

I'm looking to use gradle to run tests in declarative pipeline jobs.

Looking at docs here under tools I should be able to spec a gradle tool in 
the tools section:
https://jenkins.io/doc/book/pipeline/syntax/#declarative-steps

So I created a job like this:

pipeline {
    agent any
    tools {
        gradle "GRADLE_LATEST"
    }
    stages {
        stage('Gradle') {
            steps {
                sh 'gradle --version'
            }
        }
    }
}

But I am getting an error that gradle is not a valid tool type:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
WorkflowScript: 4: Invalid tool type "gradle". Valid tool types: [ant, 
hudson.tasks.Ant$AntInstallation, 
com.cloudbees.jenkins.plugins.customtools.CustomTool, 
org.jenkinsci.plugins.docker.commons.tools.DockerTool, git, 
hudson.plugins.git.GitTool, hudson.plugins.gradle.GradleInstallation, 
hudson.plugins.groovy.GroovyInstallation, jdk, hudson.model.JDK, jgit, 
org.jenkinsci.plugins.gitclient.JGitTool, jgitapache, 
org.jenkinsci.plugins.gitclient.JGitApacheTool, maven, 
hudson.tasks.Maven$MavenInstallation, 
hudson.plugins.mercurial.MercurialInstallation] @ line 4, column 9.
           gradle "GRADLE_LATEST"
           ^

1 error


This is on Jenkins Enterprise 2.32.1.1 with version 1.0 of the Pipeline Model 
plugins installed and with the gradle tool plugin installed and configured.


Has anyone got gradle to work with declarative pipeline?


I think I had it working with scripted pipeline sytax but I prefer this tools 
section.


Thanks for any help,

Bill

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/e5506ea0-e080-47b3-b885-cba24454ea61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to