Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not execute Findbugs Caused by: This project contains Java source files that are not compiled

I am currently using the sonarqube server 5.6 with scanner 2.6.1 and I keep getting errors during analysis for a java project. It appears to complain about some java files not compiled in the binaries folder (there aren't any at all in the binaries folder). Once I add the -X parameter I get more exceptions (flagged as ignored), see below. any clues?

sonar-project.properties followed by logs

sonar.projectKey=myproj
sonar.projectName=myproj
sonar.projectVersion=1.1
sonar.branch=1.1
sonar.sources=./java
sonar.binaries=./deploy
sonar.log.level=DEBUG
sonar.verbose=false
sonar.sourceEncoding=UTF-8


INFO: Execute Checkstyle 6.12.1 done: 2365 ms
INFO: Sensor CheckstyleSensor (done) | time=2377ms
INFO: Sensor SCM Sensor (wrapped)
INFO: SCM provider for this project is: svn
INFO: 9 files to be analyzed
DEBUG: Working directory: D:\Apps\xxxx
DEBUG: Annotate file java/src/xxxx.java
DEBUG: Annotate file java/src/xxxx.java
DEBUG: Annotate file java/src/xxxx.java
DEBUG: Annotate file java/src/xxxx.java
DEBUG: Annotate file java/src/xxxx.java
DEBUG: Annotate file java/src/xxxx.java
DEBUG: Annotate file java/src/xxxx.java
DEBUG: Annotate file java/src/xxxx.java
DEBUG: Annotate file java/src/xxxx.java
INFO: 9/9 files analyzed
INFO: Sensor SCM Sensor (wrapped) (done) | time=3289ms
INFO: Sensor FindBugs Sensor (wrapped)
WARN: Findbugs needs sources to be compiled. Please build project before 

executing sonar or check the location of compiled classes to make it possible for Findbugs to analyse your project.
    INFO: ------------------------------------------------------------------------
    INFO: EXECUTION FAILURE

execution without the -e param

WARN: Findbugs needs sources to be compiled. Please build project before executing sonar or check the location of compiled classes to make it possible for Findbto analyse your project. then java.lang.IllegalStateException: Can not execute Findbugs

Caused by: java.lang.IllegalStateException: This project contains Java source files that are not compiled. at org.sonar.plugins.findbugs.FindbugsConfiguration.getFindbugsProject(FindbugsConfiguration.java:120) at org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.

with the -X parameter

com.puppycrawl.tools.checkstyle.api.CheckstyleException: missing key 'severity' in SuppressionCommentFilter

then multiple exceptions DEBUG: Keep looking, ignoring exception com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to find class for com.puppycrawl.tools.checkstyle.checks.sizes.WhitespaceAroundCheck

then WARN: Findbugs needs sources to be compiled. Please build project before executing sonar or check the location of compiled classes to make it possible for then INFO: EXECUTION FAILURE

like image 421
NicolasW Avatar asked Aug 23 '16 13:08

NicolasW


3 Answers

It works for me after defining :

sonar.java.binaries=[YOUR_BUILD_DIR] (target/classes)

seen in :

https://github.com/SonarQubeCommunity/sonar-findbugs/issues/49

like image 74
NicolasW Avatar answered Nov 04 '22 16:11

NicolasW


We had the same issue for some projects (mainly Play Framework projects). I reverted the FindBugs plugin in SonarQube from version 3.4.3 to 3.3 (that I used on SonarQube 5.5) and then the analysis worked again.

like image 32
AndersHA Avatar answered Nov 04 '22 16:11

AndersHA


My working configuration for SonarQube 6.2 with Maven-Multi-Module project

Parent

-- Module1

-- Module2

sonar.projectKey=projectKey
sonar.projectName=Project Name
sonar.projectVersion=1.0

sonar.modules=Module1,Module2

sonar.sources=src
sonar.sourceEncoding=UTF-8
sonar.language=java
like image 3
kevcodez Avatar answered Nov 04 '22 17:11

kevcodez