简体   繁体   English

为什么Eclipse的SonarQube插件使用“项目名称”而不是“artifactID”来将Maven项目与SonarQube服务器相关联?

[英]Why does the SonarQube plugin for Eclipse use the “project name” instead of the “artifactID” to associate Maven projects with a SonarQube server?

For Maven multi-module projects, I have noticed that the plugin does the module association using the name of its directory inside the workspace , rather than using the artifactID contained inside the POM . 对于Maven多模块项目,我注意到插件使用工作空间内的目录名称来执行模块关联,而不是使用POM中包含的artifactID Because of this, if I change the name of the project to anything else, I cannot longer run successful incremental analyses. 因此,如果我将项目名称更改为其他任何内容,我将无法再运行成功的增量分析。 How can I fix this (undesired) behaviour? 我该如何解决这个(不受欢迎的)行为?

Once your Eclipse project is associated to a remote SonarQube project, changing its name should have no impact (association is a dedicated metadata). 将Eclipse项目与远程SonarQube项目关联后,更改其名称应该没有影响(关联是专用元数据)。

By default when you try to associate an Eclipse project we use the project name to do the search. 默认情况下,当您尝试关联Eclipse项目时,我们使用项目名称来进行搜索。 This is because we want to be independent from Maven and support any Eclipse project. 这是因为我们希望独立于Maven并支持任何Eclipse项目。

Using the SonarQube m2e connector may help since it will automatically try to associate your Maven project with a remote project having the key <groupId>:<artifactId> which is the default key for a Maven project. 使用SonarQube m2e连接器可能会有所帮助,因为它会自动尝试将Maven项目与具有键<groupId>:<artifactId>的远程项目相关联,这是Maven项目的默认键。

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

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