SonarQube:如何分析曾经是另一个项目子模块的项目?

时间:2016-02-16 13:26:36

标签: maven sonarqube

我有一个带聚合器POM和几个子模块的项目:

com.example:root
  |- com.example:module-a
  |- com.example:module-b
  |- com.example:module-c

决定module-b需要是一个单独的项目,因此目录module-b被拆分为一个单独的git存储库。

现在我们有两个项目:

com.example:root
  |- com.example:module-a
  |- com.example:module-c

com.example:module-b
使用SonarQube对

com.example:root进行了长时间的分析。我使用了maven目标sonar:sonar

现在,当我使用SonarQube分析com.example:module-b时,我收到此错误:

2016.02.16 13:03:24 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Failed to execute task AVLqLZdJf9ZlZw0WwFfK
org.sonar.api.utils.MessageException: Validation of project failed:
  o The project "com.example:project-b" is already defined in SonarQube but as a module of project "com.example:root". If you really want to stop directly analysing project "com.example:root", please first delete it from SonarQube and then relaunch the analysis of project "com.example:project-b".
2016.02.16 13:03:24 ERROR [o.s.s.c.t.CeWorkerCallableImpl] Executed task | project=com.example:project-b | id=AVLqLZdJf9ZlZw0WwFfK | time=302ms

事情是,是的,过去com.example:project-b确实是com.example:root的一个模块,但现在已经不存在了。我也不想停止分析com.example:root,我也不想删除它,并且放弃所有历史记录和所有其他模块。

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:4)

我们有SonarQube 5.1.2。这就是我试图用我们的版本解决这个问题的方法。如果这个确切的程序不起作用,也许它会给你解决问题的想法,然后我们会改进答案。

  • 登录SonarQube
  • 查看多模块项目
  • 在项目菜单中,点击设置 - >更新密钥
  • 在密钥列表中查找module-b,并提供其他名称 - 也许module-b-old
  • 运行多模块分析以查看是否仍然有效
  • 运行module-b分析以查看现在是否有效。

还有一个重置链接;不确定那是做什么的。

相关问题