Must-share information (formatted with Markdown):
- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
SonarQube 8.9 CE
Scanner sonar-scanner-4.6.2.2472-windows
jacoco 0.8.5
jdk jdk8
mvn 3.6 - what are you trying to achieve
I’d like to show code coverage and unit-tests data in sonarqube project. Coverage is shown correctly, while unit-tests is not. - what have you tried so far to achieve this
mvn clean org.jacoco:jacoco-maven-plugin:0.8.5:prepare-agent install org.jacoco:jacoco-maven-plugin:0.8.5:report -Dmaven.test.failure.ignore=true >build.log
sonar-scanner -Dsonar.projectName=test -Dsonar.projectKey=test -Dsonar.java.source=1.8 -Dsonar.sources=src/main -Dsonar.language=java -Dsonar.sourceEncoding=UTF-8 -Dsonar.java.binaries=target/classes -Dsonar.java.coveragePlugin=jacoco -Dsonar.jacoco.reportPath=target/jacoco.exec -Dsonar.junit.reportsPath=target/surefire-reports -Dsonar.surefire.reportsPath=target/surefire-reports -Dsonar.projectVersion=1 -Dsonar.scm.provider=git -Dsonar.host.url=http://xxxxxxxx:9000 -Dsonar.login=xxxxxxxxx -Dsonar.branch.name=master > scan.log
I also changed sonar.junit.reportsPath to sonar.junit.reportPaths but it didn’t help.
I’m sure there is surefire xml report in target/surefire-reports.
INFO: Scanner configuration file: E:\sonar-scanner-4.6.2.2472-windows\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.6.2.2472
INFO: Java 11.0.11 AdoptOpenJDK (64-bit)
INFO: Windows 10 10.0 amd64
INFO: User cache: C:\Users\****\.sonar\cache
INFO: Scanner configuration file: E:\sonar-scanner-4.6.2.2472-windows\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarQube server 8.9.2
INFO: Default locale: "zh_CN", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=111ms
INFO: Server id: BF41A1F2-AXyh0TDx4_yYli2P7GUo
INFO: User cache: C:\Users\*****\.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=51ms
INFO: Load/download plugins (done) | time=116ms
INFO: Process project properties
INFO: Process project properties (done) | time=6ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=1ms
INFO: Project key: test
INFO: Base dir: E:\GIT\********
INFO: Working dir: E:\GIT\********\.scannerwork
INFO: Load project settings for component key: 'test'
INFO: Load project settings for component key: 'test' (done) | time=30ms
INFO: Load project branches
INFO: Load project branches (done) | time=36ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=30ms
INFO: Load branch configuration
INFO: Load branch configuration (done) | time=1ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=73ms
INFO: Load active rules
INFO: Load active rules (done) | time=1699ms
INFO: Branch name: master
INFO: Indexing files...
INFO: Project configuration:
INFO: 75 files indexed
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for java: Sonar way
INFO: ------------- Run sensors on module test
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=32ms
INFO: Sensor JavaSquidSensor [java]
INFO: Configured Java source version (sonar.java.source): 8
INFO: JavaClasspath initialization
INFO: JavaClasspath initialization (done) | time=9ms
INFO: JavaTestClasspath initialization
INFO: JavaTestClasspath initialization (done) | time=1ms
INFO: Java Main Files AST scan
INFO: 70 source files to be analyzed
INFO: Load project repositories
INFO: Load project repositories (done) | time=92ms
INFO: 69/70 files analyzed, current file: src/main/java/*******
INFO: 70/70 source files have been analyzed
WARN: Dependencies/libraries were not provided for analysis of SOURCE files. The 'sonar.java.libraries' property is empty. Verify your configuration, as you might end up with less precise results.
WARN: Unresolved imports/types have been detected during analysis. Enable DEBUG mode to see them.
INFO: Java Main Files AST scan (done) | time=10146ms
INFO: Java Test Files AST scan
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Java Test Files AST scan (done) | time=1ms
INFO: Java Generated Files AST scan
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Java Generated Files AST scan (done) | time=0ms
INFO: Sensor JavaSquidSensor [java] (done) | time=10452ms
INFO: Sensor CSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [cssfamily] (done) | time=0ms
INFO: Sensor PmdSensor [pmd]
INFO: Sensor PmdSensor [pmd] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list.
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=125ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=1ms
INFO: Sensor FindBugs Sensor [findbugs]
INFO: Loading findbugs plugin: E:\GIT\******\.scannerwork\findbugs\findsecbugs-plugin.jar
INFO: Findbugs output report: E:\GIT\*******\.scannerwork\findbugs-result.xml
INFO: Sensor FindBugs Sensor [findbugs] (done) | time=8592ms
INFO: Sensor SurefireSensor [java]
INFO: parsing [E:\GIT\********\target\surefire-reports\TEST-com.***.main.RedisTest.xml]
INFO: Sensor SurefireSensor [java] (done) | time=4ms
INFO: Sensor Removed properties sensor [java]
WARN: Property 'sonar.jacoco.reportPath' is no longer supported. Use JaCoCo's xml report and sonar-jacoco plugin.
INFO: Sensor Removed properties sensor [java] (done) | time=1ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=2ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=3ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=0ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=1ms
INFO: Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerPullRequestPropertySensor
INFO: Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerPullRequestPropertySensor (done) | time=1ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=8ms
INFO: Sensor Java CPD Block Indexer
INFO: Sensor Java CPD Block Indexer (done) | time=146ms
INFO: CPD Executor 14 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 56 files
INFO: CPD Executor CPD calculation finished (done) | time=69ms
INFO: Load New Code definition
INFO: Load New Code definition (done) | time=26ms
INFO: Analysis report generated in 182ms, dir size=818 KB
INFO: Analysis report compressed in 947ms, zip size=317 KB
INFO: Analysis report uploaded in 132ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://********:9000/dashboard?id=test&branch=master
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://******:9000/api/ce/task?id=AX2FJ6Nc_ypHoEx9BnGV
INFO: Analysis total time: 25.320 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 26.541s
INFO: Final Memory: 27M/104M
INFO: ------------------------------------------------------------------------