Install a community plugin (analyzerX) that defines language X and provides 1 built-in profile, "X profile". This profile becomes the default.
Shut SonarQube down, remove analyzerX and replace it with SonarX, which (also) defines language X and provides 1 built-in profile, "Sonar way". Restart SonarQube.
X profile is retained, and remains the default, although it now has 0 rules.
Sonar way is also available.
Ensure that if the default quality profile for an organization is a built-in quality profile without any rules (so we should be in the case of removing a previous plugin), is a built-in quality profile containing at least one rule for a specific language.
There is no direct link between a built-in quality profile and a plugin. And some quality profiles can be inherited from the built-in, so deleting a built-in quality profile would require either to :
- Removing the inheritance,
- Move the inheritance to a new quality profile.
Both solutions may break the configuration and are done during startup, making those actions "magical" and users may not understand what happened. If the deletion of the plugin was a mistake, recovering from this mistake will be hard for the user (first he needs to understand what happened and must recreate the quality profiles).