Custom plugin java rules don't detect any bugs

Hi everybody,

I have found the origin of the issue: I have forgotten to register the CheckRegistrar in the Plugin Context.
I think that this point is may be missing in the https://docs.sonarqube.org/display/PLUG/Writing+Custom+Java+Rules+101#WritingCustomJavaRules101-RuleActivation paragraph.
Thanks to the ones who have developed the great Sonar plugin examples :wink:
Here is the code which has the solution:
https://github.com/SonarSource/sonar-custom-rules-examples/blob/master/java-custom-rules/src/main/java/org/sonar/samples/java/MyJavaRulesPlugin.java

I will definitely have to dive a little bit more in the API for getting more confident with writing new plugins.

Cheers
Emmanuel

1 Like