首先,我了解this question。由于我既不使用maven也不使用jenkins,我无法使用提供的解决方案。
在使用声纳跑步者分析我的项目时,我收到以下警告:
Class 'XXX/XXX/XXX' is not accessible through the ClassLoader
我项目的每个课程。我还从jacoco coverage插件中收到以下警告:
No JaCoCo analysis of project coverage can be done since there is no class files.
我的声纳 - 跑步者属性定义如下:
sonar.sources=com // sources are analysed
sonar.tests=Tests/JUnit/com // works, since wrong location results in an error
sonar.binaries=bin/com // no presence in logs
sonar.java.libraries=dependencies/*.jar // no presence in logs.
sonar.junit.reportsPath=rapports/junit // results are displayed
sonar.java.coveragePlugin=jacoco
sonar.jacoco.reportPath=rapports/jacoco/coverage.exec // not logged
毋庸置疑,我检查了各种路径(事件由他们的绝对对手替换它们或通过列出二进制文件中的每个jar)但我无法进行分析。
关于可能出错的任何想法?
答案 0 :(得分:4)
您的项目结构看起来像旧的Eclipse / WSAD结构,其中您拥有根目录上的源和编译类的“bin /”文件夹。您的应用程序代码看起来像是包含以com.
所以我假设这是你的结构:
project root +-- * = source files +-- bin/* = compiled files +-- Tests/JUnit/* = test source files +-- dependencies/*.jar = extra JAR files +-- rapports/junit/* = JUnit test results +-- rapports/jacoco/coverage.exec = Jacoco results
您的配置应该是:
sonar.sources=. sonar.tests=Tests/JUnit sonar.jacoco.reportPath=rapports/jacoco/coverage.exec sonar.junit.reportsPath=rapports/junit sonar.java.binaries=bin sonar.java.libraries=dependencies/*.jar sonar.inclusions=com/**
sonar.inclusions
应该有更完整的路径,例如
sonar.inclusions=com/trajano/project/**