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

查看:471
本文介绍了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个项目:

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.

我该如何解决?

推荐答案

我们有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天全站免登陆