首页 > 解决方案 > 如何将 SpringBoot 项目连接到 SonarQube

问题描述

我正在尝试使用 maven 插件将我的 Spring Boot 应用程序连接到 SonarCloud。具体来说,我正在尝试运行(我从 SonarCloud 教程中获得了这些说明):

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

一切似乎都很好,但我收到了这个错误:

[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. -

我一直在检查我的用户的声纳权限,一切看起来都很好。我认为我的用户有权限,因为我有来自同一个 GitHub 帐户的另一个项目正在工作并由 Sonar 进行分析。你有类似的问题吗?

标签: javamavenspring-bootsonarqube

解决方案


感谢@Fabrice,我设法解决了这个问题。事实证明,我使用的是一个groupId:artifactId已经在 SonarCloud 中使用的。所以只是改变groupIdartifactId工作。


推荐阅读