Aishwaryameenakshi
Aishwaryameenakshi

Reputation: 219

"Sonar Profile didn't match" error however the profile is mapped correctly in SonarQube

While building the code, the following message is logged in the SonarQube Scanner step:

sonar.profile was set to 'xxxxxxxx profile' but didn't match any profile for any language. Please check your configuration.

This message is logged even though the 'xxxxxxxx profile' is available and mapped to the corresponding language. This was working in the past and encountering this error only recently. There have been no recent changes in the configuration or related settings via UI and also no module of any other language (i.e. other language without association with quality profile) is committed.

What could be the cause of this issue and how to resolve this?

Upvotes: 2

Views: 1728

Answers (2)

Fab089
Fab089

Reputation: 21

We ran into the same issue and at first thought the settings does not work. But it actually works.

You need to have one quality-profile with the matching name for every language used by the analyzed project. For instance:

  • if you specify sonar.profile=MY_PROFILE
  • and your project uses Java and XML as languages (as our project does)
  • you need to have two quality-profiles with MY_PROFILE as name, one for Java one for XML

Upvotes: 2

G. Ann - SonarSource Team
G. Ann - SonarSource Team

Reputation: 22824

sonar.profile was deprecated several years ago with the introduction of multi-language analysis.

If you nonetheless use sonar.profile - rather than having a project administrator associate the project to the desired profiles via the UI - then you must have a profile of that name for each language found during analysis. From the error, you don't.

Upvotes: 3

Related Questions