SonarQube未能从Jenkins项目获得git blame信息 [英] SonarQube fails to get git blame information from Jenkins project
问题描述
我配置了一个Jenkins主项目 P
来管理两个git仓库 A
和 B
。这个主项目 P
只会更新git来源,并且会调用他的工作区中声源的声纳分析。
这是我的树文件夹。
{Jenkins安装路径} \ workspace \ P
| - A
| - - .git /
| - 所有项目A文件
| - B
| - .git /
| - 所有项目B文件
code>
当詹金斯对 P
进行声纳分析时,出现以下错误
该项目的SCM提供者为:git
2664个待分析文件
0/2664个文件分析
缺少以下文件的责任信息:
(所有文件)
错误是合乎逻辑的,因为SonarQube正在寻找 .git
文件夹下 {Jenkins安装路径} \ workspace \ P
。它不存在。
我环顾了互联网寻找解决方案,但我没有找到答案。我使用安装在Windows上的SonarQube 5.5。
您是否有一些想法让SonarQube能够使用我的配置?
这种情况不同于 Sonarqube:缺少以下文件的责任信息,因为根本原因是我使用了两个git文件夹获取通过一次SonarQube分析。
我访问并阅读过几次的消息来源
基于@ CSchulz的答案,我发现解决方案使用< a href =http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner =nofollow> SonarQube模块
我将SonarQube配置为使用对应于我的 A
和 B
git项目的两个子模块。每个项目都将git模块的名称作为重要的 projectBaseDir
参数。
sonar.projectKey = P
sonar.projectName = P
sonar.projectVersion = 4.0.0
sonar.binaries =。
sonar.cxx.includeDirectories = Common / Path
sonar.cxx.cppcheck.reportPath = cppCheckReport.xml#报告存在于A和B forlder中
# 2模块定义
sonar.modules = A,B
#模块A
IHM.sonar.projectBaseDir = A
IHM.sonar.projectName = A
IHM.sonar.sources =。
IHM.sonar.cxx.includeDirectories = XXX
#模块B
Shares.sonar.projectBaseDir = B
Shares.sonar.projectName = B
Shares.sonar.sources =。
Shares.sonar.cxx.includeDirectories = XXX
我需要弄清楚一些配置,但它工作,对我来说很好。
I configured a Jenkins Main Project P
to manage two git repository A
and B
. This main project P
only updates git sources and calls sonar analysis on sources from his workspace.
Here's my tree folder.
{Jenkins Install Path} \ workspace \ P
|-- A
|-- .git/
|-- all projects A files
|-- B
|-- .git/
|-- all projects B files
When Jenkins runs sonar analysis for P
, I got the following error
SCM provider for this project is: git
2664 files to be analyzed
0/2664 files analyzed
Missing blame information for the following files:
(all files)
The error is logical because SonarQube is looking for a .git
folder under {Jenkins Install Path} \ workspace \ P
. It doesn't exist.
I looked around the internet to find a solution but I didn't find an answer. I am using SonarQube 5.5 installed on windows.
Do you have some idea to make SonarQube working with my configuration ?
This case is different than Sonarqube: Missing blame information for the following files because the root cause is I am using two git folder fetch by a single SonarQube analysis.
Sources I visited and read several times
Seems similar but different issue
Based on @CSchulz's answer I found the solution using SonarQube module
I configured SonarQube to use two submodule corresponding to my A
and B
git projects. Each project get the name of git module as the important projectBaseDir
parametre.
sonar.projectKey=P
sonar.projectName=P
sonar.projectVersion=4.0.0
sonar.binaries=.
sonar.cxx.includeDirectories=Common/Path
sonar.cxx.cppcheck.reportPath=cppCheckReport.xml # Reports are present in A and B forlder
# 2 modules definition
sonar.modules=A,B
# Module A
IHM.sonar.projectBaseDir=A
IHM.sonar.projectName=A
IHM.sonar.sources=.
IHM.sonar.cxx.includeDirectories=XXX
# Module B
Shares.sonar.projectBaseDir=B
Shares.sonar.projectName=B
Shares.sonar.sources=.
Shares.sonar.cxx.includeDirectories=XXX
I needed to figure out some configurations but it works and it is fine for me.
这篇关于SonarQube未能从Jenkins项目获得git blame信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!