Ignored classes could not be matched to its original source file

  • Gradle plugin 2.6.2
  • Excluded classes not being excluded due (probably) to Sonar not being able to match the found bytecode with the actual class file.
  • steps to reproduce: Use the following JaxbBuildings.txt (15.3 KB)

Simplified build.gradle

sonarqube {
  properties {
    property "sonar.exclusions", "\*\*/com/qa/automation/lib/capi/models/jaxbmodels/*"
  }
}

Output:

|build|09-Aug-2018 14:23:23|The class 'com.qa.automation.lib.capi.models.jaxbmodels.JaxbBuildings' could not be matched to its original source file. It might be a dynamically generated class.|
|build|09-Aug-2018 14:23:23|The class 'com.qa.automation.lib.capi.models.jaxbmodels.JaxbBuildings$Building' could not be matched to its original source file. It might be a dynamically generated class.|

I should note that the same issue happens for classes which do not contain an inner class. Also, these files are not dynamically generated, but rather statically generated.

  • potential workaround: None known

Hello @dankling

Looks like this output comes from sonar-findbugs plugin. I suggest you to ask for the help there.

Also I’m not sure that exclusions the way you defined them will work, you have leading slash which means that path is absolute and the slashes are different.