[英]Wrong projectKey with Jenkins Build on Sonar Analysis
I'm having some trouble and I'm trying to fix my Jenkins builds. 我遇到了一些麻烦,我正在尝试修复我的Jenkins版本。
I use it to build the same project but different branches. 我用它来构建相同的项目,但不同的分支。 So, to separate the result for the Sonar analysis.
因此,要分离声纳分析的结果。
In the Build tab from my project, the options I set are : clean install -DtestFailureIgnore sonar:sonar -Dsonar.projectKey=MY_PROJECT_KEY
在我项目的Build选项卡中,我设置的选项是:
clean install -DtestFailureIgnore sonar:sonar -Dsonar.projectKey=MY_PROJECT_KEY
For some builds, it just works perfectly fine, and for some others, my project key in Sonar become groupId:artifactId
using the pom.xml
data, and it makes Sonar mixing some of the branches. 对于某些构建,它只是工作得很好,对于其他一些,我在Sonar中的项目键变为
groupId:artifactId
使用pom.xml
数据,它使Sonar混合了一些分支。
Does anyone know how to help about that problem? 有谁知道如何帮助解决这个问题?
Sonar version: 5.4
声纳版本:
5.4
Jenkins version: 1.651.1
詹金斯版本:
1.651.1
This is expected behaviour. 这是预期的行为。 When analysing Maven projects with the SonarQube Scanner for Maven ,
sonar.projectKey
is automatically set to <groupId>:<artifactId>
. 使用SonarQube Scanner for Maven分析Maven项目时,
sonar.projectKey
会自动设置为<groupId>:<artifactId>
。
To analyse different branches of the same project: do not override sonar.projectKey
, simply use the sonar.branch
parameter. 要分析同一项目的不同分支:不要覆盖
sonar.projectKey
,只需使用sonar.branch
参数。
Full details in the SonarQube Analysis Parameters documentation . SonarQube分析参数文档中的完整详细信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.