I’m using SonarLint-Plugin for Intellij, My test classes are analyzing for the default sonar profile.
But when I change the project default profile to a custom quality profile in the sonarQube test classes are not analyzed.
Only main package classes are analyzed
Please help me to resolve my issue
- IDE name and flavor/env - intellij idea 2022.1
- SonarLint plugin version -6.7
- Is connected mode used SonarQube
my pom file :
So first be aware that the properties defined in the pom file won’t be used by SonarLint. Instead SonarLint relies on the IDE project details to decide what are the source and test folders.
Reassigning the quality profile on the server side should be reflected in the IDE instantly since recent versions of SonarLint (6.6) and SonarQube (9.4).
If you use an older version of SonarQube, an automatic synchronization happens every hour anyway. You can also manually update your project binding, by going to the IDE Settings > Tools > SonarLint, select the connection to your SonarQuber server and click the ‘Update binding’ button.
If you still don’t get any issue raised, please check that the rules you expect to raise issues are activated in the custom quality profile.
If it still does not work, could you please share with us the logs of the analysis ? Please see here how to get them.
Thank you @Damien_Urruty for the reply .
When I ran "mvn clean verify sonar:sonar " command-line test classes scan with my defined ruleset and show the errors in the sonarQube report
But in the sonarLint analysis log section, I can see the Test classes but not scan with my rules.
SonarQube 9.4 community edition
I’m afraid I can’t help much without having access to the logs, could you share them with us ?