简体   繁体   English

如何将SpringBoot项目连接到SonarQube

[英]How to connect a SpringBoot project to SonarQube

I am trying to connect my Spring Boot application to SonarCloud, using a maven plugin for it. 我正在尝试使用maven插件将Spring Boot应用程序连接到SonarCloud。 Concretely, I am trying to run (I got these instructions from SonarCloud tutorial): 具体来说,我正在尝试运行(我从SonarCloud教程获得了这些说明):

mvn sonar:sonar \\ -Dsonar.organization=myacconunt-github \\ -Dsonar.host.url=https://sonarcloud.io \\ -Dsonar.login=mygeneratedtoken

Everything seems good but I got this error: 一切似乎都很好,但是我得到了这个错误:

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar (default-cli) on project demo: You're only authorized to execute a local (preview) SonarQube analysis without pushing the results to the SonarQube server. Please contact your SonarQube administrator. -

I have been checking Sonar permissions for my user and everything looks good. 我一直在为我的用户检查Sonar权限,并且一切看起来都不错。 I think my user has permissions, since I have another project from the same GitHub account working and being analysing by Sonar. 我认为我的用户具有权限,因为我有一个来自同一GitHub帐户的另一个项目正在由Sonar进行分析。 Do you have similar problems to that one? 您有与此类似的问题吗?

Thanks to @Fabrice I managed to solve that issue. 感谢@Fabrice,我设法解决了这个问题。 It turned out that I was using a groupId:artifactId which was already used in SonarCloud. 原来,我使用的是在SonarCloud中已经使用过的groupId:artifactId So just changing either groupId or artifactId worked. 因此,只需更改groupIdartifactId

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

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