Please provide
- Operating system: Windows Server 2022
- SonarLint plugin version: 10.3.0.77475
- Intellij IDEA version : 2022.3.3
- Programming language you’re coding in: Java
- Is connected mode used: Yes
- Connected to SonarCloud or SonarQube (and which version):
SonarQube Community Edition Version 9.9.3 (build 79811)
- Connected to SonarCloud or SonarQube (and which version):
And a thorough description of the problem / question:
Custom rule execution issue via. SonarLint.
Steps :
- A new quality profile is created in SonarQube and set as a DEFAULT profile.
- Few custom rules have been developed and activated in the default quality profile, along with “Sonar Way BUILT IN” rules
- In IntelliJ IDEA, Integrate SonarLint to SonarQube project and execute code analysis via SonarLint. Custom rules were NOT executed. The SonarLint tab displays the issues only from the “Sonar Way BUILT IN” rules. “Update local storage” has been clicked in the SonarLint settings and tried again - same output (“Found 0 issues and 0 hotspots”).
- With the same SonarQube configuration, Code analysis is performed via. Jenkins (Project “Build Now” operation). All custom rules are executed as expected in the SonarQube UI, along with “Sonar Way” ( all BUILT IN) rules.
- Now return to IntelliJ IDEA and execute code analysis via the SonarLint tab - All custom rules executed successfully, along with “Sonar Way” ( all BUILT IN) rules. Expected response received in SonarLint tab of IntelliJ IDEA.
Question:
Why SonarLint did NOT execute all the custom rules checks in step 3, but executed the same custom rules in the step 5 ( using the same SonarQube configuration)?
Custom plugin was packaged using the sonarLintSupported = TRUE option in pom.xml
<plugin>
<groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId>
<artifactId>sonar-packaging-maven-plugin</artifactId>
<version>1.18.0.372</version>
<extensions>true</extensions>
<configuration>
<!-- the entry-point class that extends org.sonar.api.SonarPlugin -->
<pluginClass>com.mydemoproject.sonarqube.SonarPlugin</pluginClass>
<sonarLintSupported>true</sonarLintSupported>
<sonarQubeMinVersion>6.7</sonarQubeMinVersion>
<pluginDescription>sonarqube custom rules</pluginDescription>
<skipDependenciesPackaging>true</skipDependenciesPackaging>
<!-- properly declare dependency on SonarJava for SonarLint -->
<requirePlugins>java:5.11</requirePlugins>
</configuration>
</plugin>
Please advise if I am missing anything to execute the custom rules via SonarLint as we only like to use SonarLint for code analysis ( not via Jenkins’s Build → SonarQube for all projects).