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

21 views
Skip to first unread message

rell...@gmail.com

unread,
Jul 12, 2018, 8:06:07 AM7/12/18
to Jenkins Users
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?

Reply all
Reply to author
Forward
0 new messages