Giter Club home page Giter Club logo

Comments (6)

gtoison avatar gtoison commented on July 17, 2024 1

This should be fixed in version 4.2.3 (just released)
Note that the fix needs the SonarQube version to be >= 9.8

from sonar-findbugs.

gtoison avatar gtoison commented on July 17, 2024

Hello @eirisdg are the JSP sources compiled into .class files and are they in folder /builds/[...]/target/classes ?
I'm asking because I see that in your logs:

96106 [ERROR] sonar.java.binaries was set to /builds/[...]/target/classes

SpotBugs needs the .class files because it analyses the compiled bytecode, not the source files. So when it finds sources files but not class files it throws that error.

I don't know or use the Branch Community Plugin, any idea what might be causing the problem?

from sonar-findbugs.

eirisdg avatar eirisdg commented on July 17, 2024

Hello @gtoison.

Yes, the classes are in the folder.

It's strange, because if I don't set the vars related to branch plugin, the SpotBugs scanner works well.
In the same way that if I disable the spotbug plugin, the scanner works well.

I don't know why, but definitely is related to some incompatibility with this plugin:
https://github.com/mc1arke/sonarqube-community-branch-plugin
I can't try with payment version sonar that supports branches by default if the error is present there to.

from sonar-findbugs.

gtoison avatar gtoison commented on July 17, 2024

I looked into it and I have no idea what might be causing the problem: the plugin uses Sonar's built-in JavaResourceLocator to get the .class files:

for (File file : javaResourceLocator.classpath()) {

So my best guess would be that during Pull Request analysis sonar's JavaResourceLocator behaves differently and maybe only returns the class files corresponding to modified sources?

It will be hard for me to investigate this if I'm not able to reproduce the problem; would you be able to debug it on your end?
I'd like to know what's happening inside

public void addPrecompiledJspClasses(List<File> classFilesToAnalyze) throws IOException {

You can debug the maven build using mvnDebug instead of mvn and then attach a remote debugger to it

from sonar-findbugs.

eirisdg avatar eirisdg commented on July 17, 2024

I looked into it and I have no idea what might be causing the problem: the plugin uses Sonar's built-in JavaResourceLocator to get the .class files:

for (File file : javaResourceLocator.classpath()) {

So my best guess would be that during Pull Request analysis sonar's JavaResourceLocator behaves differently and maybe only returns the class files corresponding to modified sources?

It will be hard for me to investigate this if I'm not able to reproduce the problem; would you be able to debug it on your end? I'd like to know what's happening inside

public void addPrecompiledJspClasses(List<File> classFilesToAnalyze) throws IOException {

You can debug the maven build using mvnDebug instead of mvn and then attach a remote debugger to it

I would like to know how to debug it, but I'm not developer, only SRE. :/

from sonar-findbugs.

gtoison avatar gtoison commented on July 17, 2024

I tried reproducing the problem but could not so far
I think you need to give me more information here and ideally a small project (plus setup instructions) so I can reproduce
What version or sonarqube are you using?

from sonar-findbugs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.