user1340582
user1340582

Reputation: 19729

Can class files be excluded in Sonar just as Java files can?

In Sonar there is an Exclusions navigation tab on the left of the front screen. There you can "Exclude sources from code analysis.". Does this mean only .java files, or can .class files be excluded too? I am getting a lot of warnings in Sonar where some classes cannot be found from the classloader, referring to classes such as Hibernate.

Upvotes: 0

Views: 1857

Answers (1)

The problem you've got is related to a badly configured classpath in your POM file or Ant Script or Sonar Project properties file. This has nothing to do with exclusions ("sonar.exclusions" only excludes source files).

To fix this, you have to:

  • correctly set your dependencies in the POM if your using Maven

  • correctly set the "sonar.libraries" property if your using Ant or Sonar Runner (check this example to know more about this property)

Upvotes: 0

Related Questions