Sonarqube doesn't show code coverage after launch
I am running sonarque with maven.
I installed it using the following method . Using brew
, I installed mysql
and sonar
.
When I run I get 7 critical errors, but the code coverage for 88 tests is zero
When I run it using IntelliJ tools, I get the following results. (not zero!)
This is when I check the Jacoco results directly. IN$base_direc/target/jacoco/index.html
Same code when run with sound scanner
Edit 1: I found this in the logs.
Edit2: I edited ~/.m2/settings.xml
added
<properties>
<sonar.host.url>http://localhost:9000/</sonar.host.url>
</properties>
Edited /usr/local/Cellar/sonarqube/6.3.1/libexec/conf/sonar.properties
Addedsonar.host.url=http://localhost:9000/
Edited /usr/local/etc/sonar-scanner.properties
-sonar.host.url=http://localhost:9000/
Run the app in all of the above ways and the results were the same, meaning I could see Jacoco's results, but not in sonar.
Is it possible that if errors are found, the sonar will refuse to perform code coverage ?!
source to share
I found a solution -
The maven plugin I have included has Jacoco destoc and datafile config as ${basedir}/target/coverage-reports/jacoco-unit.exec
but by default the sonar reads ${basedir}/target/jacoco.exec
. I changed the default to http: // localhost: 9000 / settings? Category = java
Ref: Sonar Coverage Code
source to share