SonarQube:如何分析曾经是另一个项目的子模块的项目? [英] SonarQube: How to analyze project that used to be submodule of another project?

查看:16
本文介绍了SonarQube:如何分析曾经是另一个项目的子模块的项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a project with an aggregator POM and several submodules:

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

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

It was decided that module-b needs to be a separate project, so the directory module-b was split off into a separate git repository.

现在我们有 2 个项目:

Now we have 2 projects:

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

com.example:module-b

com.example:root 用 SonarQube 分析了很长时间.我使用 maven 目标 sonar:sonar.

com.example:root was analyzed for a long time with SonarQube. I use the maven goal sonar:sonar.

现在,当我用 SonarQube 分析 com.example:module-b 时,我得到了这个错误:

Now when I analyze com.example:module-b with SonarQube, I get this error:

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 也不想删除它并丢失所有历史记录和所有其他模块.

The thing is, yes, in the past com.example:project-b was indeed a module of com.example:root, but it isn't any more now. I also don't want to stop analyzing com.example:root and I don't want to delete it and loose all history and all other modules.

我该如何解决这个问题?

How do I solve this?

推荐答案

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

We have SonarQube 5.1.2. This is how I would try to fix this issue with our version. If this exact procedure doesn't work, maybe it will give you ideas for solving the problem and then we'll refine the answer.

  • 登录 SonarQube
  • 查看多模块项目
  • 在项目菜单中,点击设置 --> 更新密钥
  • 在键列表中找到 module-b,并提供一个替代名称 - 可能是 module-b-old
  • 运行多模块分析,看看是否仍然有效
  • 运行 module-b 分析,看看现在是否有效.
  • Log into SonarQube
  • View the multi-module project
  • In the project menu, click Settings --> Update Key
  • Find module-b in the list of keys, and provide an alternative name - maybe module-b-old
  • Run multi-module analysis to see if that still works
  • Run module-b analysis to see if that works now.

还有一个重置链接;不知道那是做什么的.

There is also a Reset link; not sure what that does.

这篇关于SonarQube:如何分析曾经是另一个项目的子模块的项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆