How can Sonar be configured to import new rulesets?

10,628

The rules are defined in the sonar server as a set of configurations for pmd, findbugs, checkstyle etc.

You have to reference a configuration in your pom file (see the sonar documentation/wiki).

the property is sonar.profile

But basically you will assign the profile for the project in the sonar server configuration. (see Profiles Section in the Wiki). Profiles will also allow you to move rule configurations between environments, e.g. between development and production.

Share:
10,628
adrianos
Author by

adrianos

Updated on August 24, 2022

Comments

  • adrianos
    adrianos over 1 year

    With maven-pmd-plugin, I am able to configure it to scan my unit tests for PMD violations:

    <configuration>
    <rulesets>
    <ruleset>/rulesets/junit.xml</ruleset>
    </rulesets>

    Sonar 2.0.1 doesn't seem to provide any way to add in new rulesets that I can see. Has anyone figured out how to do this?