How to declare tool type "hudson.plugins.sonar.SonarRunnerInstallation" in declarative pipeline?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to declare tool type "hudson.plugins.sonar.SonarRunnerInstallation" in declarative pipeline?

rella.guo
Hi, I am trying to run sonar scanner by declarative pipeline with tools.

In declarative pipeline, I can define "tools" and I know valid tool types are [ant, hudson.tasks.Ant$AntInstallation, org.jenkinsci.plugins.docker.commons.tools.DockerTool, git, hudson.plugins.git.GitTool, 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, hudson.plugins.sonar.SonarRunnerInstallation, hudson.plugins.sonar.MsBuildSQRunnerInstallation]

But when I set hudson.plugins.sonar.SonarRunnerInstallation in pipeline tools, I get error.
The pipeline is:
pipeline {
    agent any
    tools
{
       
hudson.plugins.sonar.SonarRunnerInstallation 'sonar-scanner-3.2.0'
   
}
    stages
{
       
...
   
}
}

The error message is "unexpected token: sonar-scanner-3.2.0".
Does anyone know how to set sonar runner tool in declarative pipeline?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/13880785-ca29-4f97-b12b-aa366cd04fef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.