Hello everyone!
I am trying to use a pipeline job in Jenkins (version 2.263.1) able to create a sonarQube report (Sonar version is 7.9.5). This is for a Python application whose code is in Subversion 1.6.11. I mention this because most of examples I have found use Maven, Gradle or Git. I have tried to adapt these examples to my circumstances but I am not able to make it work…
The current code I have in my pipeline is:
pipeline {
agent any
stages {
stage('Hello') {
steps {
echo 'Hello World'
}
}
stage('Adios'){
steps{
echo 'Adiós'
}
}
stage('Checkout'){
steps{
checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[cancelProcessOnExternalsFail: true, credentialsId: 'Jenkins_user', depthOption: 'infinity', ignoreExternalsOption: true, local: '.', remote: 'https://svn.oepm.local/DEVOPS/Jurisprudencia_Python']], quietOperation: true, workspaceUpdater: [$class: 'UpdateUpdater']])
}
}
stage('SonarQube analysis') {
steps{
script{
def scannerHome = tool 'SonarRunner_3.3.0';
}
withSonarQubeEnv('My SonarQube Server') {
sh "${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=Jurisprudencia_ORCTXT -Dsonar.sources=. -Dsonar.login=69d977f11910740d9ca95b75cede210db01489c9"
}
}
}
}
}
The error message is:
ERROR: SonarQube installation defined in this job (My SonarQube Server) does not match any configured installation. Number of installations that can be configured: 1.
If you want to reassign jobs to a different SonarQube installation, check the documentation under SonarScanner for Jenkins | SonarQube Docs
Of couse, I have already checked that link, but it didn’t help me.
I have taken a look to my configuration and this is what I see:
As it can be seen, the reference “SonarRunner_3.3.0” is defined in my Jenkins configuration so I don’t understand what the error message means.
I have also checked that a project with that key exists in sonarQube, so is not the problem.
Any idea or suggestion? What am I doing wrong?
Thanks in advance.