1
votes

To begin with, I'm aware of this question. Since I'm neither using maven or jenkins, I can't use the provided solution.

When analysing my project with sonar-runner, I get the following warning :

Class 'XXX/XXX/XXX' is not accessible through the ClassLoader

on every class of my project. I also get the following warning from the jacoco coverage plugin :

No JaCoCo analysis of project coverage can be done since there is no class files.

My sonar-runner properties are defined as follows :

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

Needless to say, I checked the various path (event replaced them by their absolute counterparts or by listing every jar in binaries) but I'm unable to make the analysis.

Any ideas on what may go wrong ?

1

1 Answers

4
votes

Your project structure looks like the old Eclipse/WSAD structure where you have sources on the root and a "bin/" folder for your compiled classes. Your application code looks like it has a package definition that starts with com.

So I am presuming this is your structure:

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

Your configuration should be:

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/**

The sonar.inclusions should have a more full path e.g.

sonar.inclusions=com/trajano/project/**