Issue with inherited sonar.organization property using a self hosted instance

  • which versions are you using : by looking at the maven output, it seems the Sonar Scanner plugin version is sonar-maven-plugin:3.7.0.1746 . The server is SonarQube version: 6.7.6

I’m trying to analyze project https://github.com/xwiki/xwiki-platform and make it to appear in a self-hosted SonarQube instance. For this I am compiling the project and run tests (this part is ok).

The problem I have is with the next step, the sonar:sonar goal where I get:

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.7.0.1746:sonar (default-cli) on project xwiki-platform: Unable to load component class org.sonar.scanner.report.MetadataPublisher: Unable to load component class org.sonar.scanner.rule.ModuleQProfiles: Error 404 on https://sonarqube.self.hosted/api/qualityprofiles/search.protobuf?defaults=true&organization=xwiki : {"errors":[{"msg":"No organization with key ''xwiki"}]} -> [Help 1]

Notice that the sonar project properties are source within the parent POM at https://github.com/xwiki/xwiki-commons/blob/8e91e4db2a19e7ef5dd623cca76c290a2bf6da0b/pom.xml#L177

And that I have opened a thread at XWiki project https://forum.xwiki.org/t/issue-with-sonar-organization-with-self-hosted-sonar-instance/5736 where a maintainer says that he don’t understand “that the server take into account the sent organization if it does not know the concept of organization.”

And as far as I know, there is no way to add an organization into a self hosted instance of SonarQube.

Of course I have tried to add -Dsonar.organization= but in doesn’t unset the property, just set it as empty string. So I’m kind of stuck.

How can we achieve this ?