Skip to content

Report Paths

guwirth edited this page Jan 28, 2021 · 3 revisions

To read reports the .reportPaths property is used. The property is structured as follows:

  • multiple paths may be comma-delimited:

    sonar.cxx.cppcheck.reportPaths=c:/reports/cppcheck1.xml
    sonar.cxx.cppcheck.reportPaths=c:/reports/cppcheck1.xml,c:/reports/cppcheck2.xml
  • may be absolute or relative to the project base directory:

    sonar.cxx.cppcheck.reportPaths=c:/reports/cppcheck1.xml
    sonar.cxx.cppcheck.reportPaths=../reports/cppcheck1.xml
  • may contain wildcards:

    sonar.cxx.cppcheck.reportPaths=c:/reports/cppcheck?.xml
    sonar.cxx.cppcheck.reportPaths=../reports/cppcheck-*.xml

Hints:

  • The location of your configuration file sonar-project.properties defines the project base directory.
  • Reports should be excluded from scanning, otherwise they will be analyzed themselves (e.g. XML files). The easiest way to do this is to store them outside the project base directory.
  • Narrowing the Focus gives more hints how to include and exclude files.

Wildcards

Paths with wildcards are relative to the project base directory. The following wildcards can be used:

  • * - Match zero or more characters
  • ** - Match zero or more directories
  • ? - Match a single character

Wildcard examples

Example Matches Does not match
**/*Report.rpt org/reports/MyReport.rpt
org/sonar/util/MyOtherReport.rpt
org/sonar/util/MyOther.rpt
org/sonar/util/Report2.rpt
**/*Report?.rpt org/sonar/util/MyOtherReport1.rpt org/sonar/util/MyOtherReport.rpt
org/reports/MyReport.rpt
org/sonar/util/MyOther.rpt
org/sonar/* org/sonar/MyReport.rpt
org/sonar/MyOtherReport.rpt
org/sonar/util/MyReport.rpt
org/sonar/**/* org/sonar/MyReport.rpt
org/sonar/MyOtherReport.rpt
org/sonar/util/MyReport.rpt
Clone this wiki locally