Coverage issue in SonarQube 7.9.4 for Gradle build

Hi All,

One of the users is facing Coverage issue in SonarQube 7.9.4. However their local build is showing coverage.

Please check below properties and Error logs. Please assist if we can modify the properties.
Project scanner properties:

  • sonar.binaries=/data/jenkins/workspace/SonarQube/Sonar-UserContext-test/build/classes/main
  • sonar.host.url=https://sonarqube.pearson.com
  • sonar.jacoco.reportPath=/data/jenkins/workspace/SonarQube/Sonar-UserContext-test/build/jacoco/jacoco.exec
  • sonar.jacoco.reportPaths=/data/jenkins/workspace/SonarQube/Sonar-UserContext-test/build/jacoco/jacoco.exec
  • sonar.java.binaries=/data/jenkins/workspace/SonarQube/Sonar-UserContext-test/build/classes/main
  • sonar.java.libraries=/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-web/1.5.1.RELEASE/8404c45cb53a05edcd0ad8fc57a5fe43462263d8/spring-boot-starter-web-1.5.1.RELEASE.jar,/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-hateoas/1.5.1.RELEASE/989b59fe2d2fa9df1fc89c241c444e11370d37cc/spring-boot-starter-hateoas-1.5.1.RELEASE.jar,/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/com.pearson.ed.ltg.piam/authentication-filter/3.6.0/54917dabe5b572e958f933736a8ba2017144f716/authentication-filter-3.6.0.jar,/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/com.pearson.ed.ltg.piam/system-authenticator/3.6.0/931967d552b5102b278ffec916bc0899119c26d6/system-authenticator-3.6.0.jar,/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/org.springframework.data/spring-data-redis/1.8.1.RELEASE/a1bc2034d8b00090edb991f208d491e78d610457/spring-data-redis-1.8.1.RELEASE.jar,/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/red…
  • sonar.java.source=1.8
  • sonar.java.target=1.8
  • sonar.java.test.binaries=/data/jenkins/workspace/SonarQube/Sonar-UserContext-test/build/classes/test
  • sonar.java.test.libraries=/data/jenkins/workspace/SonarQube/Sonar-UserContext-test/build/classes/main,/data/jenkins/workspace/SonarQube/Sonar-UserContext-test/build/resources/main,/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-web/1.5.1.RELEASE/8404c45cb53a05edcd0ad8fc57a5fe43462263d8/spring-boot-starter-web-1.5.1.RELEASE.jar,/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-hateoas/1.5.1.RELEASE/989b59fe2d2fa9df1fc89c241c444e11370d37cc/spring-boot-starter-hateoas-1.5.1.RELEASE.jar,/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/com.pearson.ed.ltg.piam/authentication-filter/3.6.0/54917dabe5b572e958f933736a8ba2017144f716/authentication-filter-3.6.0.jar,/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/com.pearson.ed.ltg.piam/system-authenticator/3.6.0/931967d552b5102b278ffec916bc0899119c26d6/system-authenticator-3.6.0.jar,/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/org.springframework.data/spring-dat…
  • sonar.junit.reportsPath=/data/jenkins/workspace/SonarQube/Sonar-UserContext-test/build/test-results/test
  • sonar.libraries=/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-web/1.5.1.RELEASE/8404c45cb53a05edcd0ad8fc57a5fe43462263d8/spring-boot-starter-web-1.5.1.RELEASE.jar,/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot-starter-hateoas/1.5.1.RELEASE/989b59fe2d2fa9df1fc89c241c444e11370d37cc/spring-boot-starter-hateoas-1.5.1.RELEASE.jar,/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/com.pearson.ed.ltg.piam/authentication-filter/3.6.0/54917dabe5b572e958f933736a8ba2017144f716/authentication-filter-3.6.0.jar,/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/com.pearson.ed.ltg.piam/system-authenticator/3.6.0/931967d552b5102b278ffec916bc0899119c26d6/system-authenticator-3.6.0.jar,/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/org.springframework.data/spring-data-redis/1.8.1.RELEASE/a1bc2034d8b00090edb991f208d491e78d610457/spring-data-redis-1.8.1.RELEASE.jar,/var/lib/jenkins/.gradle/caches/modules-2/files-2.1/red…
  • sonar.login=******
  • sonar.password=******
  • sonar.projectBaseDir=/data/jenkins/workspace/SonarQube/Sonar-UserContext-test
  • sonar.projectKey=com.pearson:user-context-service
  • sonar.projectName=user-context-service
  • sonar.projectVersion=1.0.0
  • sonar.scanner.app=ScannerGradle
  • sonar.scanner.appVersion=2.4-SNAPSHOT/3.4
  • sonar.sourceEncoding=UTF-8
  • sonar.sources=/data/jenkins/workspace/SonarQube/Sonar-UserContext-test/src/main/java
  • sonar.surefire.reportsPath=/data/jenkins/workspace/SonarQube/Sonar-UserContext-test/build/test-results/test
  • sonar.tests=/data/jenkins/workspace/SonarQube/Sonar-UserContext-test/src/test/java
  • sonar.working.directory=/data/jenkins/workspace/SonarQube/Sonar-UserContext-test/build/sonar
  • error observed (wrap logs/code around triple quote ``` for proper formatting)
    Started by timer
    Started by user ********
    Rebuilds build #600
    Running as SYSTEM
    Building in workspace /data/jenkins/workspace/SonarQube/Sonar-UserContext
    No credentials specified

git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
git config remote.origin.url ssh://git@bitbucket.pearson.com/ucs/user-context-service.git # timeout=10
Fetching upstream changes from ssh://git@bitbucket.pearson.com/ucs/user-context-service.git
git --version # timeout=10
git fetch --tags --progress ssh://git@bitbucket.pearson.com/ucs/user-context-service.git +refs/heads/:refs/remotes/origin/ # timeout=10
git rev-parse feature/PRDCT-7422-sonar-bugfixes-in-ucs^{commit} # timeout=10
git rev-parse refs/remotes/origin/feature/PRDCT-7422-sonar-bugfixes-in-ucs^{commit} # timeout=10
Checking out Revision 644f47eef9f4351252d34b5430743f9d07d60c43 (refs/remotes/origin/feature/PRDCT-7422-sonar-bugfixes-in-ucs)
git config core.sparsecheckout # timeout=10
git checkout -f 644f47eef9f4351252d34b5430743f9d07d60c43 # timeout=10
Commit message: “sonar url update”
git rev-list --no-walk 644f47eef9f4351252d34b5430743f9d07d60c43 # timeout=10
[Sonar-UserContext] $ /bin/sh -xe /tmp/jenkins1003247274787737349.sh

  • ./gradlew sonarqube -Dsonar.host.url=https://sonarqube.pearson.com -Dsonar.login=-Dsonar.password=*
    Starting a Gradle Daemon (subsequent builds will be faster)
    :compileJava
    :processResources UP-TO-DATE
    :classes
    :compileTestJava
    :processTestResources UP-TO-DATE
    :testClasses
    :test
    :sonarqube
    SonarScanner will require Java 11 to run starting in SonarQube 8.x
    API compatibility mode is no longer supported. In case of error, plugin Japanese Pack [l10nja] should package its dependencies.
    Cobertura report not found at /data/jenkins/workspace/SonarQube/Sonar-UserContext/target/site/cobertura/coverage.xml
    Clover XML report not found
    BUILD SUCCESSFUL
    Total time: 3 mins 44.156 secs
    Finished: SUCCESS

P.S.: use the bug:fault sub-category if you’re hitting a specific crash/error , or the #bug:fp sub-category for rules-related behaviour

Hello,

I notice property sonar.jacoco.reportPaths=/data/jenkins/workspace/SonarQube/Sonar-UserContext-test/build/jacoco/jacoco.exec
version of sonar-java above 6.0 is removing support for importing JaCoCo coverage report in binary format (.exec file). Coverage for Java should be imported with JaCoCo XML report via sonar-jacoco plugin.
The analysis logs should reflect this with a Warning message when the deprecated property is still used during the analysis.

You may read details in the paragraph “Bye bye Jacoco .exec format” from this page

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.