Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »


This plugin is used to exclude some violations in a fine-grained way. It allows to define some exclusion patterns to switch off violations :

  • By rule
  • By file
  • By line or range of lines


Download the plugin from Update Center and restart server.

If you don't have access to Internet, then manually download JAR file into $SONAR_HOME/extensions/plugins and restart server.


The configuration of the plugin is done in the Web admin console, where you can specify the exclusion patterns in the textarea (one per line):

  • Comments start with #
  • Blank lines are allowed
  • A line defines 3 fields: resource key, rule key and range of lines.


# suppress all violations

# exclude the Java file;*;*

# exclude a Java package*;*;*

# exclude a specific rule

# exclude a specific rule on a specific file;;*

# exclude on specific lines 10, 25 and 90;*;[10,25,90]

# exclude on a range of lines;*;[10-90]

# exclude on many ranges of lines;*;[10-90,92,98,120-150]

Note: prior to version 1.1, the only way to specify exclusions was to write them in a file and fill the "sonar.switchoffviolations.configFile" property with the location of that file. This feature is still supported, even if it is best to use the Web admin console to configure the plugin.







T Key Summary Assignee Reporter P Status Resolution Created Updated Due


  • No labels