這是我的Jenkins Build Log
Started by user root
Running as SYSTEM
Building in workspace /var/lib/jenkins/workspace/Sonar
using credential gitlab
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url http://root@172.16.16.63/root/scott.git # timeout=10
Fetching upstream changes from http://root@172.16.16.63/root/scott.git
> git --version # timeout=10
using GIT_ASKPASS to set credentials gitlab
> git fetch --tags --progress http://root@172.16.16.63/root/scott.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision e4278f02b998f688476def1681a1b83d2c59fede (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f e4278f02b998f688476def1681a1b83d2c59fede
Commit message: "java 003"
> git rev-list --no-walk e4278f02b998f688476def1681a1b83d2c59fede # timeout=10
Injecting SonarQube environment variables using the configuration: admin
[Sonar] $ /var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonar_scanner/bin/sonar-scanner -Dsonar.host.url=http://172.16.16.23:9000/ -Dsonar.projectName=JackySonar -Dsonar.projectVersion=1.0 -Dsonar.sourceEncoding=UTF-8 -Dsonar.projectKey=Sonar -Dsonar.dynamicAnalysis=false -Dsonar.sources=/var/lib/jenkins/workspace/Sonar/Jacky003.class -Dsonar.projectBaseDir=/var/lib/jenkins/workspace/Sonar
INFO: Scanner configuration file: /var/lib/jenkins/tools/hudson.plugins.sonar.SonarRunnerInstallation/sonar_scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 4.0.0.1744
INFO: Java 1.8.0_212 Oracle Corporation (64-bit)
INFO: Linux 3.10.0-957.el7.x86_64 amd64
INFO: User cache: /var/lib/jenkins/.sonar/cache
INFO: SonarQube server 7.1.0
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Publish mode
INFO: Load global settings
INFO: Load global settings (done) | time=100ms
INFO: Server id: AWwXwu9HiPzPiWQqqBxi
INFO: User cache: /var/lib/jenkins/.sonar/cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=129ms
INFO: Load/download plugins
INFO: Load/download plugins (done) | time=220ms
INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories (done) | time=404ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=18ms
INFO: Load active rules
INFO: Load active rules (done) | time=1377ms
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=136ms
INFO: Project key: Sonar
INFO: Project base dir: /var/lib/jenkins/workspace/Sonar
INFO: ------------- Scan JackySonar
INFO: Load server rules
INFO: Load server rules (done) | time=247ms
INFO: Base dir: /var/lib/jenkins/workspace/Sonar
INFO: Working dir: /var/lib/jenkins/workspace/Sonar/.scannerwork
INFO: Source paths: Jacky003.class
INFO: Source encoding: UTF-8, default locale: en_US
INFO: Index files
INFO: 1 file indexed
INFO: Sensor SonarJavaXmlFileSensor [java]
INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=1ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=70ms
INFO: Sensor CPD Block Indexer
INFO: Sensor CPD Block Indexer (done) | time=0ms
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 1138ms, dir size=23 KB
INFO: Analysis reports compressed in 120ms, zip size=5 KB
INFO: Analysis report uploaded in 69ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://172.16.16.23:9000/dashboard/index/Sonar
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://172.16.16.23:9000/api/ce/task?id=AWwYV20XiPzPiWQqqCrj
INFO: Task total time: 8.938 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 12.139s
INFO: Final Memory: 11M/142M
INFO: ------------------------------------------------------------------------
Finished: SUCCESS
由上面可以知道,Jenkins確實有掃到資料並傳送到SonarQube中 (如下圖)
但是查看SonarQube發現,確實有資料傳輸進來,但資料內容卻都是「零」
研究不少天了,目前看起來SonarQube和Jenkins是有通的,但似乎沒撈到資料
該筆資料內容為