How can Sonar be configured to import new rule sets?

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

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

Sonar 2.0.1 does not seem to provide any way to add the new rule sets that I see. Has anyone figured out how to do this?

+6
source share
1 answer

Rules are defined on the sonar server as a set of configurations for pmd, findbugs, checkstyle, etc.

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

sonar.profile property

But basically, you will assign a profile for the project in the configuration of the sonar server. (see the "Profiles" section of the Wiki ). Profiles will also allow you to move rule configurations between environments, for example. between development and production.

+4
source

Source: https://habr.com/ru/post/885637/


All Articles