简体   繁体   English

模块“ M1:M1”已经是项目“ P1”的一部分

[英]Module “M1:M1” is already part of project “P1”

We have 2 sonar projects (P1 & P2) running on 2 different/independent GIT repositories (G1 & G2) . 我们有2个 声纳项目(P1 & P2)在2个不同/独立的GIT存储库(G1 & G2) Both the projects run on different branches (P1 runs on B1 & P2 runs on B2 ). 这两个项目都在不同的分支上(P1 runs on B1 & P2 runs on B2 )。

we have 2 plugins/modules named M1 & M2 in both GITs G1 and G2 on different branches. 我们在不同分支的GITs G1G2都有2 plugins/modules名为M1M2 2 plugins/modules

  1. In sonar project P1 we have analysis & coverage for 2 modules (M1 & M2) . 在声纳项目P1我们对2个模块(M1 & M2)进行了分析和覆盖。

  2. In sonar project P2 we have ignored these 2 modules (M1 & M2) both from analysis and coverage. 在声纳项目P2我们从分析和覆盖范围上都忽略了这两个模块(M1 & M2) ie, i have included them in "sonar.coverage.exclusions" and "sonar.exclusions" . 即,我已经将它们包括在“ sonar.coverage.exclusions”和"sonar.exclusions" Even then when we run sonar project P2 we are getting error 即使这样,当我们运行声纳项目P2 ,也会出现错误

Error message : 错误信息 :

Module "M1:M1" is already part of project "P1"

Module "M2:M2" is already part of project "P1"

I am curious why this error is displayed as they are from different GIT repositories and different branches of them. 我很好奇为什么显示此错误,因为它们来自不同的GIT存储库和它们的不同分支。

Kindly suggest how can i resolve this issue. 请提出如何解决此问题。 thank you. 谢谢。

It is not very intuitive that beside project names also the module names need to be unique in sonarqube. 在项目名称之外,模块名称在sonarqube中也必须唯一,这不是很直观。 I think there might be a difference adding exclusions and disable the sonar report for that module. 我认为添加排除项和禁用该模块的声纳报告可能有所不同。 exclusions might still lead to some report. 排除可能仍会导致某些报告。

So I would disable the sonar report for these to modules via the skip property: 因此,我将通过skip属性禁用向这些模块的声纳报告

<sonar.skip>true</sonar.skip>

in the pom files of the two modules you don't want to have reported again. 在两个模块的pom文件中,您不想再次报告。

that should avoid having the sonar plugin trying to create such a module in sonar. 应该避免让声纳插件尝试在声纳中创建这样的模块。 In the worst case you may need to delete an older project in sonar that already contains that module where it does not belong. 在最坏的情况下,您可能需要删除声纳中的旧项目,该项目中已经包含了不属于该模块的模块。 Then re-create the reports. 然后重新创建报告。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM