Exclusion of Java Test Files from SonarQube 4.1.1 Analysis

I do not report any violations that should be reported for Java test files in SonarQube, but I want to analyze and display JUnit and Cobertura code coverage (JUnit reports and code covers are reused and not executed by SonarQube).

How to exclude only test files from violation analysis? I tried to add these parameters to the global exception, but they do not work:

**/test/**
**/Test*.*

thank

+3
source share
1 answer

SonarQube may ignore problems with certain components and against certain coding rules. You can read the section Ignore Issues on Multiple Criteriaon SonarQube Narrowing Focus .

As stated in the documentation:

.

:

  • = > *; **/*
  • COBOL/ZTR00021.cbl = > *; bank/ZTR00021.cbl
  • , Java com.foo, = > ; com/foo/
  • , cpp.Union = > cpp.Union; object/**/*
+5

All Articles