Open fcandalija opened 3 years ago
Hi @fcandalija!
Using archives as inputs to the sonar.java.binaries
property seems to work with the standard Java analyzer (or it would fail for me too!), but it looks like the Findbugs plugin is doing an additional check for 'source-like' content which is getting triggered in this case: https://github.com/spotbugs/sonar-findbugs/blob/master/src/main/java/org/sonar/plugins/findbugs/FindbugsConfiguration.java#L122
If you check out the sonar-project.properties files in bazel-bin
, what values are being set there? I wouldn't expect it to be anything other than .jar
files - and indeed that's what I get locally - but maybe I've missed something.
When building the first iteration of this tool I think there was no good way to get the .class
files out of Bazel - IIRC java_library
doesn't provide them as rule outputs.
I can think of a couple of options:
sonar.java.binaries
:grinning:
Hi @Zetten
I am testing this plugin on a Java codebase against a SonarQube server with the FindBugs sensor enabled in its Quality Profile. When I run the scanner in my project I end up seeing this error:
It looks like the error happens because the FindBugs sensor is expecting the
sonar.java.binaries
property to be pointing to the directory containing all the*.class
files, instead of to the output jar file, which is what the code is currently doing:Indeed, the Sonar documentation defines sonar.java.binaries as:
Any idea how could we access the *.class files directory to see if this error is fixed? I checked on the JavaInfo provider and there's nothing in the outputs. I am quite new with Bazel and still not sure how this could be achieved.
Thanks for the plugin and the help!