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 Sonarqube Analysis

When I run it using IntelliJ tools, I get the following results. (not zero!) IntelliJ analysis

This is when I check the Jacoco results directly. IN$base_direc/target/jacoco/index.html


Jacoco Results

Same code when run with sound scanner sonar-scanner


This is my maven config
Maven config

My ~/.m2/settings.xml


settings-pic1
settings-pic2


Edit 1: I found this in the logs. Db not supported


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 ?!

+3


source to share


1 answer


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

+2


source







All Articles