How to retrigger "define" functions of rulesdefinition in new version of sonarQube?

Here is a normal configure steps of our plugins.

  1. Install plugins
  2. Go to External Analyzer tab and set up tool’s root dir.
  3. Restart sonarQube and the plugin will load rules into sonarQube automatically.

But in newer version of Sonarqube, i’ve noticed sonarQube add a changesDetect for plugins. If the MD5 of my jar file is not changed, the define function in RulesDefinition will not be executed.

Thus it will make no differences after i restart sonarQube in new verison.
My question: is there any way to trigger the define function now?So i can load rules after i restart sonarQube. Or is there any to add external rule to sonarqube that exclude Adding XPath rules and Importing generic issue reports


Welcome to the community!

I don’t understand this step:

I’ve never been aware of such a step and have no idea what it would do.

The way to load new rules in SonarQube would be to provide a plugin that defines them. They’ll be added when the plugin is loaded…?



Let me try to help clarify some details regarding our issue.

We have implemented a SonarQube plugin that displays static analysis violations in the report generated by our language products. Once the plugin is installed, we ask the user to specify the root path of our product installation folder (in the External Analyzer section of the administration configuration) and to restart the server. This way, the rules will be loaded from the installation folder upon server restart.

However, after upgrading to 9.6+, it seems that the plugin and rules are only reloaded if the plugin is updated. This causes an issue for us because after the user specifies the root path and restarts the server, the rules will not be loaded because it appears to be part of the plugin reloading process.

We would like to receive some suggestions from you regarding the following questions:

  1. Are there any APIs that can be used to reload the rules without reloading the plugin? Because in our case, we need to: load plugin → restart the server with root path specified → load rules
  2. If not, are there any suggested ways to reload the rules?


I don’t think this should have ever worked. You were exploiting a bug. The rules should be in the plugin.