无法执行Findbugs原因:此项目包含未编译的Java源文件 [英] Can not execute Findbugs Caused by: This project contains Java source files that are not compiled
问题描述
我目前正在将声纳服务器5.6与扫描仪2.6.1结合使用,并且在对Java项目进行分析时不断出现错误. 似乎抱怨有些Java文件未在Binaries文件夹中编译(binaries文件夹中根本没有文件). 添加-X参数后,我将获得更多异常(标记为已忽略),请参见下文. 有任何线索吗?
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,后跟日志
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
不带有-e参数的执行
execution without the -e param
警告:Findbugs需要编译源.请在执行声纳之前构建项目或检查已编译类的位置,以使Findb可以分析您的项目. 然后 java.lang.IllegalStateException:无法执行Findbugs
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
由于:java.lang.IllegalStateException:该项目包含未编译的Java源文件. 在org.sonar.plugins.findbugs.FindbugsConfiguration.getFindbugsProject(FindbugsConfiguration.java:120) 在org.sonar.plugins.findbugs.FindbugsExecutor.execute(FindbugsExecutor.
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.
带有-X参数
com.puppycrawl.tools.checkstyle.api.CheckstyleException:SuppressionCommentFilter中缺少键严重性"
com.puppycrawl.tools.checkstyle.api.CheckstyleException: missing key 'severity' in SuppressionCommentFilter
然后有多个例外 调试:继续查找,忽略异常 com.puppycrawl.tools.checkstyle.api.CheckstyleException:无法找到com.puppycrawl.tools.checkstyle.checks.sizes.WhitespaceAroundCheck的类
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
然后 警告:Findbugs需要编译源.请在执行声纳之前构建项目或检查已编译类的位置,以使其能够 然后 INFO:执行失败
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
推荐答案
定义了以下内容后对我有用:
It works for me after defining :
sonar.java.binaries=[YOUR_BUILD_DIR] (target/classes)
看过:
https://github.com/SonarQubeCommunity/sonar-findbugs/issues/49
这篇关于无法执行Findbugs原因:此项目包含未编译的Java源文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!