You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a simple maven project using the sonar-maven-plugin (3.2), sonarqube (5.6.3) and the sonar-findbugs plugin (3.4.4). The mvn command I am using is
sonar:sonar -Dsonar.java.binaries=target/classes,target/test-classes.
This is because I want to analyze all test classes for bugs. In the findbugs-result.xml I see the entry for the test class which has the bug. For a sanity check, I put the same exact bug in a main class. On the sonar project dashboard, under the Code tab, the test class is showing 0 bugs but the main class shows 1. Is this expected behavior to not show bugs for any classes in the test directory? Thank you
The text was updated successfully, but these errors were encountered:
You are exactly right, didn't even notice the warning in the log. After adding the test directory to the SOURCE_DIRECTORIES array in the ByteCodeResourceLocator class, it works! Thank you very much
So does this mean that if I want to have sources in a directory different from /{"src/main/java", "src/main/webapp", "src/main/resources", "src", "/src/java"}, I actually have to build my own custom sonar-findbugs plugin? Is there no other way I could specify a different directory?
@anzez
Sonar 5.6 has some regression. They do not provided source directories like in 5.5 and lower.
Sonar-FindBugs will not start to parse Gradle or Maven configuration.. The best option available would be to make a slow search on the list of source files of the project. This modification is tracked in #47
I have a simple maven project using the sonar-maven-plugin (3.2), sonarqube (5.6.3) and the sonar-findbugs plugin (3.4.4). The mvn command I am using is
sonar:sonar -Dsonar.java.binaries=target/classes,target/test-classes.
This is because I want to analyze all test classes for bugs. In the findbugs-result.xml I see the entry for the test class which has the bug. For a sanity check, I put the same exact bug in a main class. On the sonar project dashboard, under the Code tab, the test class is showing 0 bugs but the main class shows 1. Is this expected behavior to not show bugs for any classes in the test directory? Thank you
The text was updated successfully, but these errors were encountered: