Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SonarQube Findbugs "needs sources to be compiled"

I am trying to get SonarQube findbugs working, but when I try to run it I get the error: "Findbugs needs sources to be compiled. Please build project before executing sonar and check the location of compiled classes."

sonar.sources is set to a folder with all of my src files and sonar.binaries is set to a folder with all of my class and jar files. This layout works with findbugs for one of my projects, but on the other I get the above error.

This is the debug error provided when FindBugs will not run: http://pastie.org/9483921

How can I fix this, and is there a certain folder FindBugs needs classes/jars in to work?

Thanks.

like image 729
Kory Avatar asked Aug 18 '14 15:08

Kory


2 Answers

Add property

sonar.binaries=${workspace}/proy/build/

To Sonar Configuration. If you ar using several proyects to build, use coma separed.

like image 94
other name Avatar answered Nov 10 '22 00:11

other name


SonarQube requires source code to be built before it analyzes it. This is going to differ depending on how you are building it, but check here and click on your building platform.

For example: If you were using SonarQube to analyze a project with Maven, you must issue the following commands in this order (assuming you followed the steps according to this maven configuration page, which is linked as an option in the first link):

mvn clean install
mvn sonar:sonar

Thus, you must build the code before any sonar analysis can be done. Also note, you must issue these commands separately and you should wait for the install to finish completely before running sonar.

like image 20
Anthony E. Avatar answered Nov 09 '22 23:11

Anthony E.