2017-06-06 84 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