sonar.coverage.jacoco.xmlReportPaths not showing code coverage but the deprecated sonar.jacoco.reportPaths shows code coverage

@saberduck

Below are the logs from sonarqube command execution.

Task :app:sonarqube
WARNING: API ‘variant.getJavaCompile()’ is obsolete and has been replaced with ‘variant.getJavaCompileProvider()’.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getJavaCompile(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
SonarScanner will require Java 11+ to run starting in SonarQube 8.x
Classes not found during the analysis : [com.mikhaellopez.circularimageview.CircularImageView, org.apache.commons.logging.Log]

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use ‘–warning-mode all’ to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 4m 45s
88 actionable tasks: 87 executed, 1 up-to-date

Thanks.

use --debug to get more details

With --debug, I have lots of log, which I can’t get all together. Can you please tell me any specific gradle task which I can direct call and get the logs which are important for you to analyse the issue?

Thanks.

Interesting is part with sonarqube analysis, that should be sonarqube task

ok. But even with that command (sonarqube) it is having lots of logs. I need to check the way to get it all and provide it to you. I will get back to you with a complete log for the same.

Ideally, I have lots of files, that’s why it is taking lots of log details.

Thanks.

Hi,

This is the stacktrace of the command sonarqube. You can review that logs here.

Thanks.

Here is the log for –warn

Thanks.

@saberduck
Here you can find the complete logs of sonarqube --debug & XML reports from this link.

Please do let me know if you need anything towards detecting an issue.
Thanks.

@saberduck

Did get luck to check for the issue? I hope I have provided the details you want. Do let me know if you need anything more towards the issue.

Thanks.

@saberduck

Looking to have an update from you if you have check with the issue and details.

Thanks.

link with debug logs you provided is not publicly available, please check your sharing settings.

Also, please don’t bump the thread, this is a community forum where we volunteer to help the users (for exchange we receive valuable feedback to improve the product). If you require support with SLA, you should look at our commercial offerings.

Hi @saberduck

Sorry for the sharing option. Can you please check with this LINK.

Please do let me know if you still face any issue with that.

Thanks.

From your logs I see that only following plugins are installed

15:46:15.822 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Plugins:
15:46:15.822 [DEBUG] [org.sonarqube.gradle.SonarQubeTask]   * SonarC# 7.16.0.8981 (csharp)
15:46:15.822 [DEBUG] [org.sonarqube.gradle.SonarQubeTask]   * SonarPython 1.14.1.3143 (python)
15:46:15.822 [DEBUG] [org.sonarqube.gradle.SonarQubeTask]   * SonarJava 5.14.0.18788 (java)
15:46:15.822 [DEBUG] [org.sonarqube.gradle.SonarQubeTask]   * Code Smells 4.0.0 (smells)
15:46:15.822 [DEBUG] [org.sonarqube.gradle.SonarQubeTask]   * SonarCSS 1.1.1.1010 (cssfamily)
15:46:15.822 [DEBUG] [org.sonarqube.gradle.SonarQubeTask]   * Git 1.9.0.1725 (scmgit)
15:46:15.822 [DEBUG] [org.sonarqube.gradle.SonarQubeTask]   * ShellCheck Analyzer 2.1.0 (shellcheck)
15:46:15.822 [DEBUG] [org.sonarqube.gradle.SonarQubeTask]   * SonarTS 1.9.0.3766 (typescript)
15:46:15.822 [DEBUG] [org.sonarqube.gradle.SonarQubeTask]   * Swift (Backelite) 0.4.4 (backelitesonarswiftplugin)

You are missing sonar-jacoco plugin which processes the XML report. It is part of the default distribution, so it must have been uninstalled by someone administering your SonarQube instance. You can re-install it via marketplace.

3 Likes

Ok Thanks @saberduck for your support. I will check with same. Will update you is any more information needed.

Thanks.

You are welcome, come back if this fixed your problem or you face other issue.

@saberduck

You are missing [sonar-jacoco plugin]

This was my problem. Thanks!

1 Like

Hey I have the same problem but the link you provided above no longer exists.
Can you please send the link again?
Thanks

@Donald
The problem I was facing because we haven’t added sonar-jacoco plugin plugin to sonar server. Once we have added that and it start showing the code-coverage.

Check the configuration you did, if you feel that it is the proper one then you can check with server, whether you have added the plugin there or not.

Thanks.

I am trying to analyze my Android project and I see the same thing.

If I include following line in my sonarcube config, I see some test coverage report.

property ‘sonar.jacoco.reportPath’, fileTree(dir: project.projectDir, includes: [’**/*.exec’])

However if I set the property as shown below, I see 0% code coverage.

“sonar.jacoco.xmlReportPaths”,"${project.buildDir}/reports/jacoco/jacocoTestDebugUnitTestRep ort/jacocoTestDebugUnitTestReport.xml"

Ignore the above comment, it was my “bad” I had configuration as sonar.jacoco.xmlReportPaths instead of sonar.coverage.jacoco.xmlReportPaths