Darryl RN
Darryl RN

Reputation: 8228

Sonar-scanner in jenkins error does not match any configured installation

I installed Sonarqube plugin in Jenkins, already configured the sonarqube server and sonarqube scanner from the Jenkins configuration:

but when I ran the pipeline I got this error:

ERROR: SonarQube installation defined in this job (sonarqube) does not match any configured installation. Number of installations that can be configured: 1.

Here is the configuration: sonarqube server config sonarqube scanner config

What causing the error above?

Upvotes: 3

Views: 11153

Answers (2)

Pragadeesh
Pragadeesh

Reputation: 1

You should have proper server name which is matching the servername in jenkinsfile.

For example,

stage('Static Code Analysis: SonarQube') {
        when { expression { params.action == 'create' } }
        steps {
            script {
                def SonarQubeServerName = 'sonarqube-api'

                withSonarQubeEnv(SonarQubeServerName) {
                    sh 'mvn clean package sonar:sonar'
                }
            }
        }
    }

IN the above groovyscript, sonar servername is sonarqube-api. It should match the Name given in the jenkins configuration.

Upvotes: 0

David M. Karr
David M. Karr

Reputation: 15235

You were apparently requesting the use of installation "sonarqube", but the configured name is "SonarQubeScanner". Those don't match. I also note that calling it "SonarQubeScanner" is not quite right. That is an installation of SonarQube, not the scanner. It doesn't make sense to use the same name for SonarQube installations and SonarQube scanners. They are different things.

Upvotes: 2

Related Questions