I’m developing a custom sonarqube plugin for a language that is not officially supported by SonarQube.
I’ve updated some sonar dependencies to make it ready for 10.x, but got some deprecation notice with RulesDefinitionXmlLoader.
It says this:
Deprecated
since 9.0. Use the sonar-check-api to annotate rule classes instead of loading the metadata from XML files. See org.sonar.check.Rule.
However, the rules are loaded dynamically, because they’re defined by a different tool.
Thats how I’m using it currently: link
What is the correct way going forward, do I have to invent my own format do define the rules dynamically? Do I have to generate Java classes instead of XML which contain the @Rule annotation?
The parsing of the language is not done by the SonarQube plugin. The plugin takes a file containing information about issues etc.
Our friend @guwirth faced this with his plugin and decided to copy over the implementation of RulesDefinitionXmlLoader. Perhaps this would work for your case?
it’s important that you are using a suitable / compatible software license and the copyright remains in the file.
What I don’t understand is why Generic issue import format doesn’t support also to create a repository? This would be a replacement, see also discussion here: