# Jacoco coverage not shown neither with exec nor with xml

**URL:** <https://community.sonarsource.com/t/jacoco-coverage-not-shown-neither-with-exec-nor-with-xml/2977>\
**Category:** SonarQube Cloud\
**Tags:** jacoco\
**Created:** [September 28, 2018, 8:02pm UTC](https://community.sonarsource.com/t/jacoco-coverage-not-shown-neither-with-exec-nor-with-xml/2977 "2018-09-28T20:02:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![robstoll](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/robstoll/32/1077_2.png) [@robstoll](https://community.sonarsource.com/u/robstoll)\
**Post date:** [September 28, 2018, 8:02pm UTC](https://community.sonarsource.com/t/jacoco-coverage-not-shown-neither-with-exec-nor-with-xml/2977/1 "2018-09-28T20:02:33Z")

</div>

I am trying desperately to get jacoco’s coverage into sonarqube but don’t get it to work.  
Please have a look at the following travis config:

> <https://github.com/robstoll/tutteli-spek-extensions/blob/master/.travis.yml#L20>

I have tried multiple things:

- using the \*.exec file with -Dsonar.jacoco.reportPaths
- using the \*.xml report with -Dsonar.coverage.jacoco.xmlReportPaths
- I have set -Dsonar.jacoco.reportMissing.force.zero=true but still nothing, not even 0%

As you can see from the travis log, the files which I reference are all there (the head commands find the files):  
[https://travis-ci.org/robstoll/tutteli-spek-extensions/builds/434776896](https://travis-ci.org/robstoll/tutteli-spek-extensions/builds/434776896)

I also tried out the sonarqube gradle-plugin but with the same results, meaning no coverage is uploaded as it seems. From the travis log you can see that it always states `19:59:39.313 DEBUG: 'JaCoCoSensor' skipped because there is no related file in current project`

As side notice, jacoco works, when I am generating the html report (locally) it looks as it should, meaning the coverage is there.

I would appreciate any hint. I don’t know what I am doing wrong (or might it be that sonarcloud is not compatible with jacoco 0.8.2?). following the project on sonarcloud:  
[https://sonarcloud.io/dashboard?id=robstoll\_tutteli-spek-extensions](https://sonarcloud.io/dashboard?id=robstoll_tutteli-spek-extensions)

---

<div class="post-metadata">

**Author:** ![robstoll](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/robstoll/32/1077_2.png) [@robstoll](https://community.sonarsource.com/u/robstoll)\
**Post date:** [September 28, 2018, 8:40pm UTC](https://community.sonarsource.com/t/jacoco-coverage-not-shown-neither-with-exec-nor-with-xml/2977/2 "2018-09-28T20:40:08Z")

</div>

Seems like the JacocoSensor only picks up if there are java files involved (I added a dummy file). Yet, also then I don’t get any reports but at least I see why:

```auto
20:30:09.616 WARN: Property 'sonar.jacoco.reportMissing.force.zero' is deprecated and its value will be ignored.
20:30:09.618 INFO: No JaCoCo analysis of project coverage can be done since there is no class files.

```

So I added build/classes to `-Dsonar.sources` but this did not help, still the same message ☹  
I hope that this extra info gives someone else a clue why it does not work. In the end I would like to remove the Java dummy class.

---

<div class="post-metadata">

**Author:** ![xbourguignon](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/xbourguignon/32/55_2.png) [@xbourguignon](https://community.sonarsource.com/u/xbourguignon)\
**Post date:** [October 1, 2018, 9:46am UTC](https://community.sonarsource.com/t/jacoco-coverage-not-shown-neither-with-exec-nor-with-xml/2977/3 "2018-10-01T09:46:47Z")

</div>

Hi,

Coverage for Kotlin project is not yet available on SonarCloud, see [SonarKotlin code coverage](https://community.sonarsource.com/t/sonarkotlin-code-coverage/1269/4)

---

<div class="post-metadata">

**Author:** ![robstoll](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/robstoll/32/1077_2.png) [@robstoll](https://community.sonarsource.com/u/robstoll)\
**Post date:** [October 1, 2018, 10:40am UTC](https://community.sonarsource.com/t/jacoco-coverage-not-shown-neither-with-exec-nor-with-xml/2977/4 "2018-10-01T10:40:17Z")

</div>

Thanks for the information and link.
