I just got one standalone jacoco.xml coverage report file from a blackbox testing, it is java-based old project, there is no unit testing applied, no maven attached. It is built and tested by javac, jar, .exe cases. I tried to import it to sonarqube but failed all the time. I want to know what is the minimum configuration or information(source, lib…, sonarqube options) which can help me to do that good or am I totally wrong?
Must-share information (formatted with Markdown):
*** which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)**
17:20:26.886 INFO: Scanner configuration file: D:\sonar-scanner-4.3.0.2102-windows\bin..\conf\sonar-scanner.properties
17:20:26.888 INFO: Project root configuration file: NONE
17:20:26.912 INFO: SonarScanner 4.3.0.2102
17:20:26.912 INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
17:20:26.912 INFO: Windows 10 10.0 amd64
:
17:20:29.215 DEBUG: Plugins:
17:20:29.216 DEBUG: * SonarPython 2.8.0.6204 (python)
17:20:29.216 DEBUG: * SonarCSS 1.2.0.1325 (cssfamily)
17:20:29.216 DEBUG: * JaCoCo 1.1.0.898 (jacoco)
17:20:29.217 DEBUG: * SonarGo 1.6.0.719 (go)
17:20:29.217 DEBUG: * SonarKotlin 1.5.0.315 (kotlin)
17:20:29.217 DEBUG: * Svn 1.9.0.1295 (scmsvn)
17:20:29.217 DEBUG: * SonarJS 6.2.0.12043 (javascript)
17:20:29.217 DEBUG: * SonarRuby 1.5.0.315 (ruby)
17:20:29.217 DEBUG: * SonarScala 1.5.0.315 (sonarscala)
17:20:29.217 DEBUG: * C# Code Quality and Security 8.6.1.17183 (csharp)
17:20:29.217 DEBUG: * Java Code Quality and Security 6.3.0.21585 (java)
17:20:29.217 DEBUG: * SonarHTML 3.2.0.2082 (web)
17:20:29.217 DEBUG: * Git 1.11.1.2008 (scmgit)
17:20:29.218 DEBUG: * SonarFlex 2.5.1.1831 (flex)
17:20:29.218 DEBUG: * SonarXML 2.0.1.2020 (xml)
17:20:29.218 DEBUG: * SonarPHP 3.3.0.5166 (php)
17:20:29.218 DEBUG: * SonarTS 2.1.0.4359 (typescript)
*** what are you trying to achieve**
wanna import only jacoco xml-format coverage report to Sonarqube.
*** what have you tried so far to achieve this**
Run the following cmd from sonar-scanner,
C:\sonar-scanner-4.3.0.2102-windows\bin\sonar-scanner -X -Dsonar.projectKey=engine-javaupoc-jacoco -Dsonar.coverage.jacoco.xmlReportPaths=jacoco.xml
While I always get the issue like the following, and ) is reported in Sonarqube project.
:
17:20:33.228 INFO: Sensor JaCoCo XML Report Importer [jacoco]
17:20:33.230 INFO: Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list.
17:20:33.230 DEBUG: Reading report ‘D:\jacoco-rest\jacoco-xrpt\javaupoc-jacoco.xml’
17:20:33.298 INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=71ms
17:20:33.298 INFO: Sensor JavaXmlSensor [java]
17:20:33.302 INFO: 1 source files to be analyzed
17:20:33.451 INFO: Load project repositories
17:20:33.460 DEBUG: GET 404 http://localhost:9000/batch/project.protobuf?key=engine-javaupoc-jacoco2 | time=9ms
17:20:33.460 DEBUG: Project repository not available - continuing without it
17:20:33.461 INFO: Load project repositories (done) | time=10ms
17:20:33.461 DEBUG: ‘javaupoc-jacoco.xml’ generated metadata with charset ‘UTF-8’
17:20:34.240 INFO: 1/1 source files have been analyzed
17:20:34.240 INFO: Sensor JavaXmlSensor [java] (done) | time=942ms
17:20:34.240 INFO: Sensor HTML [web]
17:20:34.244 INFO: Sensor HTML [web] (done) | time=4ms
17:20:34.244 INFO: Sensor XML Sensor [xml]
17:20:34.246 INFO: 1 source files to be analyzed
17:20:34.692 DEBUG: Count lines in file:///D:/jacoco-rest/jacoco-xrpt/javaupoc-jacoco.xml
17:20:35.021 INFO: Sensor XML Sensor [xml] (done) | time=777ms
17:20:35.022 INFO: 1/1 source files have been analyzed
17:20:35.025 INFO: ------------- Run sensors on project
17:20:35.027 DEBUG: ‘Generic Coverage Report’ skipped because one of the required properties is missing
17:20:35.027 DEBUG: ‘Java CPD Block Indexer’ skipped because there is no related file in current project
17:20:35.028 DEBUG: Sensors : Zero Coverage Sensor
17:20:35.028 INFO: Sensor Zero Coverage Sensor
17:20:35.029 INFO: Sensor Zero Coverage Sensor (done) | time=1ms
17:20:35.031 INFO: SCM Publisher No SCM system was detected. You can use the ‘sonar.scm.provider’ property to explicitly specify it.
17:20:35.032 INFO: CPD Executor Calculating CPD for 0 files
17:20:35.034 INFO: CPD Executor CPD calculation finished (done) | time=0ms
17:20:35.141 INFO: Analysis report generated in 106ms, dir size=1 MB
17:20:35.302 INFO: Analysis report compressed in 161ms, zip size=320 KB
17:20:35.302 INFO: Analysis report generated in D:\jacoco-rest\jacoco-xrpt.scannerwork\scanner-report
17:20:35.302 DEBUG: Upload report
: