2017-06-06 83 views
0

我有一个Sonarcloud帐户,我尝试使用SonarQube.Scanner.MSBuild.exe分析Visual Studio解决方案。我创建了一个令牌并将其作为SonarQube.Analysis.xml文件中的sonar.login属性传递。 我使用https://sonarcloud.io作为sonar.host.url,但我也尝试过https://sonarqube.com将分析上传到SonarQube时出错

下面是配置的相关片段:

<Property Name="sonar.host.url">https://sonarcloud.io</Property> 
<Property Name="sonar.login">***my*token****</Property> 
<Property Name="sonar.password"></Property> 
<Property Name="sonar.organization">MyOrganization</Property> 

的分析似乎运行正常,但在当它试图上传分析Sonarcloud年底,我得到这个错误:

ERROR: Error during SonarQube Scanner execution 
ERROR: You're only authorized to execute a local (preview) SonarQube analysis without pushing the results to the SonarQube server. Please contact your SonarQube administrator. 

我试过连接到本地的Sonarqube服务器,并且工作正常。有人知道这里有什么问题吗?

回答

1

您可能会错过sonar.organization分析属性。您应该能够从项目主页上的组织键字段获取值。如果您的项目尚未存在于服务器上,您可以通过以下方式登录:我的帐户>组织

+0

感谢您的提示。不幸的是它没有奏效。我使用SonarQubeAnalysis.xml文件中的代码片段更新了问题。 – Quirijn

+0

它毕竟工作,但只有在我用MSBuild.SonarQube.Runner.exe替换了SonarQube.Scanner.MSBuild.exe之后。我不明白为什么它不适用于扫描仪。 – Quirijn