Issue: SonarQube analysis results show zero results
Versions: SonarQube Version 6.7.6 (build 38781), Scanner version: sonar-scanner-3.2.0.1227
Problem statement: We are trying to setup sonar qube analysis for Mulesoft (java based project). The analysis runs successfully but SonarQube analysis dashboard says “0 Bugs, 0 vulnerabilities” and the log says “Calculating CPD for 0 files”.
Steps so far:
We have set up the sonar qube analysis and build in Jenkins for this java based project. The verbose logs of the analysis are as below
Started by user <testuser>
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] node
Running on Jenkins in e:\Jenkins\workspace\PROGRAM-PIPELINE-TEST_REVIEW\PROGRAM-MuleSoft-POCs\mule_sonar
[Pipeline] {
[Pipeline] stage
[Pipeline] { (SCM : SVN Checkout)
[Pipeline] checkout
Switching from https://vsvn.test.com/svn/PROGRAMP/MuleSoft/branches/R1Mulesoft1.0.0.0/s-apiforwatchlistvalidation to https://vsvn.test.com/svn/PROGRAMP/MuleSoft/branches/R1Mulesoft1.0.0.0
Cleaning up e:\Jenkins\workspace\PROGRAM-PIPELINE-TEST_REVIEW\PROGRAM-MuleSoft-POCs\mule_sonar\.
Deleting e:\Jenkins\workspace\PROGRAM-PIPELINE-TEST_REVIEW\PROGRAM-MuleSoft-POCs\mule_sonar\.scannerwork
Switching to https://vsvn.test.com/svn/PROGRAMP/MuleSoft/branches/R1Mulesoft1.0.0.0 at revision '2019-05-16T02:45:44.730 -0400' --quiet
Using sole credentials JENKINS_SVCACCOUNT/****** (service account Jenkins_SVCAccount to access SVN and respective environment for deployment) in realm ‘<https://vsvn.test.com:443> VisualSVN Server’
At revision 8321
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build & Run SonarQube Analysis)
[Pipeline] withSonarQubeEnv
Injecting SonarQube environment variables using the configuration: SonarQubeServer
[Pipeline] {
[Pipeline] bat
[mule_sonar] Running batch script
e:\Jenkins\workspace\PROGRAM-PIPELINE-TEST_REVIEW\PROGRAM-MuleSoft-POCs\mule_sonar>cd e:\Jenkins\workspace\PROGRAM-PIPELINE-TEST_REVIEW\PROGRAM-MuleSoft-POCs\mule_sonar//s_apiforsalesforcetest && mvn clean install sonar:sonar -D sonar.projectKey=Mule-s_apiforsalesforcetest -D sonar.projectName=Mule-s_apiforsalesforcetest -D sonar.sources=. -Dsonar.verbose=true
[INFO] Scanning for projects...
[WARNING] The POM for org.apache.maven.plugins:maven-site-plugin:jar:3.6.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-site-plugin:3.6.1: Plugin org.apache.maven.plugins:maven-site-plugin:3.6.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:3.6.1
Downloading from :<nexus_url>
Downloading from : :<nexus_url>
Progress (1): 7.6/20 kB
Progress (1): 16/20 kB
Progress (1): 16/20 kB
Progress (1): 16/20 kB
Progress (1): 20 kB
Downloaded from : :<nexus_url>
(20 kB at 3.1 kB/s)
Progress (1): 7.6/14 kB
Progress (1): 8.2/14 kB
Progress (1): 14 kB
Downloaded from : :<nexus_url>
(14 kB at 2.1 kB/s)
Downloading from : :<nexus_url>
Progress (1): 1.2 kB
Downloaded from : :<nexus_url>
(1.2 kB at 795 B/s)
[INFO]
[INFO] --------------< com.test.Programp:S-APIForSalesforceTest >---------------
[INFO] Building S-APIForSalesforceTest 1.0.0-SNAPSHOT
[INFO] --------------------------[ mule-application ]--------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean-1) @ S-APIForSalesforceTest ---
[INFO] Deleting e:\jenkins\workspace\PROGRAM-PIPELINE-TEST_REVIEW\PROGRAM-MuleSoft-POCs\mule_sonar\s_apiforsalesforcetest\target
[INFO]
[INFO] --- mule-maven-plugin:3.1.6:clean (default-clean) @ S-APIForSalesforceTest ---
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ S-APIForSalesforceTest ---
[INFO]
[INFO] --- mule-maven-plugin:3.1.6:validate (default-validate) @ S-APIForSalesforceTest ---
[INFO]
[INFO] --- mule-maven-plugin:3.1.6:initialize (default-initialize) @ S-APIForSalesforceTest ---
[INFO]
[INFO] --- mule-maven-plugin:3.1.6:generate-sources (default-generate-sources) @ S-APIForSalesforceTest ---
[INFO]
[INFO] --- mule-maven-plugin:3.1.6:process-sources (default-process-sources) @ S-APIForSalesforceTest ---
[INFO] About to fetch required dependencies for artifact: com.test.Programp:S-APIForSalesforceTest:pom:1.0.0-SNAPSHOT. This may take a while...
[INFO] About to fetch required dependencies for artifact: org.mule.connectors:mule-sockets-connector:pom:1.1.2. This may take a while...
[INFO] About to fetch required dependencies for artifact: com.mulesoft.connectors:mule-salesforce-connector:pom:9.4.0. This may take a while...
[INFO] About to fetch required dependencies for artifact: org.mule.connectors:mule-objectstore-connector:pom:1.0.0. This may take a while...
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ S-APIForSalesforceTest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- mule-maven-plugin:3.1.6:process-resources (default-process-resources) @ S-APIForSalesforceTest ---
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ S-APIForSalesforceTest ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- mule-maven-plugin:3.1.6:compile (default-compile) @ S-APIForSalesforceTest ---
[INFO]
[INFO] --- mule-maven-plugin:3.1.6:process-classes (default-process-classes) @ S-APIForSalesforceTest ---
[INFO]
[INFO] --- mule-maven-plugin:3.1.6:generate-test-sources (default-generate-test-sources) @ S-APIForSalesforceTest ---
[INFO]
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ S-APIForSalesforceTest ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO]
[INFO] --- mule-maven-plugin:3.1.6:generate-test-resources (default-generate-test-resources) @ S-APIForSalesforceTest ---
[INFO]
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ S-APIForSalesforceTest ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- mule-maven-plugin:3.1.6:test-compile (default-test-compile) @ S-APIForSalesforceTest ---
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ S-APIForSalesforceTest ---
[INFO]
[INFO] --- mule-maven-plugin:3.1.6:package (default-package) @ S-APIForSalesforceTest ---
[INFO] Building zip: e:\jenkins\workspace\PROGRAM-PIPELINE-TEST_REVIEW\PROGRAM-MuleSoft-POCs\mule_sonar\s_apiforsalesforcetest\target\S-APIForSalesforceTest-1.0.0-SNAPSHOT-mule-application.jar
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ S-APIForSalesforceTest ---
[INFO] No primary artifact to install, installing attached artifacts instead.
[INFO] Installing e:\jenkins\workspace\PROGRAM-PIPELINE-TEST_REVIEW\PROGRAM-MuleSoft-POCs\mule_sonar\s_apiforsalesforcetest\pom.xml to E:\.m2\repository\com\test\Programp\S-APIForSalesforceTest\1.0.0-SNAPSHOT\S-APIForSalesforceTest-1.0.0-SNAPSHOT.pom
[INFO] Installing e:\jenkins\workspace\PROGRAM-PIPELINE-TEST_REVIEW\PROGRAM-MuleSoft-POCs\mule_sonar\s_apiforsalesforcetest\target\S-APIForSalesforceTest-1.0.0-SNAPSHOT-mule-application.jar to E:\.m2\repository\com\test\Programp\S-APIForSalesforceTest\1.0.0-SNAPSHOT\S-APIForSalesforceTest-1.0.0-SNAPSHOT-mule-application.jar
[INFO]
[INFO] --------------< com.test.Programp:S-APIForSalesforceTest >---------------
[INFO] Building S-APIForSalesforceTest 1.0.0-SNAPSHOT
[INFO] --------------------------[ mule-application ]--------------------------
[WARNING] The POM for org.apache.maven.plugins:maven-site-plugin:jar:3.6.1 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-site-plugin:3.6.1: Plugin org.apache.maven.plugins:maven-site-plugin:3.6.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-site-plugin:jar:3.6.1
[INFO]
[INFO] --- sonar-maven-plugin:3.6.0.1398:sonar (default-cli) @ S-APIForSalesforceTest ---
[INFO] User cache: C:\Windows\system32\config\systemprofile\.sonar\cache
[INFO] SonarQube version: 6.7.6
[INFO] Default locale: "en_US", source code encoding: "UTF-8"
[INFO] Publish mode
[INFO] Load global settings
[INFO] Load global settings (done) | time=361ms
[INFO] Server id: <serveridmasked>
[INFO] User cache: C:\Windows\system32\config\systemprofile\.sonar\cache
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=107ms
[INFO] Process project properties
[INFO] Execute project builders
[INFO] Execute project builders (done) | time=5ms
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=444ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=347ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=1946ms
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=92ms
[INFO] Project key: Mule-s_apiforsalesforcetest
[INFO] ------------- Scan Mule-s_apiforsalesforcetest
[INFO] Load server rules
[INFO] Load server rules (done) | time=250ms
[INFO] Base dir: E:\jenkins\workspace\PROGRAM-PIPELINE-TEST_REVIEW\PROGRAM-MuleSoft-POCs\mule_sonar\s_apiforsalesforcetest
[INFO] Working dir: e:\jenkins\workspace\PROGRAM-PIPELINE-TEST_REVIEW\PROGRAM-MuleSoft-POCs\mule_sonar\s_apiforsalesforcetest\target\sonar
[INFO] Source paths: .
[INFO] Test paths: src/test/java
[INFO] Source encoding: UTF-8, default locale: en_US
[INFO] Index files
[INFO] Excluded sources:
[INFO] **/*.xml
[INFO] *SL_*
[INFO] *_Test*
[INFO] *cnx_ prefix*
[INFO] 186 files indexed
[INFO] 13 files ignored because of inclusion/exclusion patterns
[INFO] Sensor SonarJavaXmlFileSensor [java]
[INFO] Sensor SonarJavaXmlFileSensor [java] (done) | time=1ms
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=60ms
[INFO] Sensor CPD Block Indexer
[INFO] Sensor CPD Block Indexer (done) | time=1ms
[INFO] Sensor Apex CPD [codescan]
[INFO] Sensor Apex CPD [codescan] (done) | time=11ms
[INFO] Sensor VisualForce/Lightning CPD [codescan]
[INFO] Sensor VisualForce/Lightning CPD [codescan] (done) | time=1ms
[INFO] SCM Publisher is disabled
[INFO] Calculating CPD for 0 files
[INFO] CPD calculation finished
[INFO] Analysis report generated in 267ms, dir size=54 KB
[INFO] Analysis reports compressed in 15ms, zip size=13 KB
[INFO] Analysis report generated in e:\jenkins\workspace\PROGRAM-PIPELINE-TEST_REVIEW\PROGRAM-MuleSoft-POCs\mule_sonar\s_apiforsalesforcetest\target\sonar\scanner-report
[INFO] Analysis report uploaded in 122ms
[INFO] ANALYSIS SUCCESSFUL, you can browse https://sonarqube.test.com/dashboard/index/Mule-s_apiforsalesforcetest
[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 https://sonarqube.test.com/api/ce/task?id=AWq_ay_PGn5AdWaqyREk
[INFO] Task total time: 7.198 s
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 31.120 s
[INFO] Finished at: 2019-05-16T02:53:54-04:00
[INFO] ------------------------------------------------------------------------