簡體   English   中英

我正在嘗試為MSBuild安裝SonarQube掃描儀

[英]I am trying to install SonarQube Scanner for MSBuild

我已經成功設置了SonarQube和C#插件。 使Sonarqube掃描儀工作時遇到麻煩。

我有以下SonarQube.Analysis.xml

<SonarQubeAnalysisProperties  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.sonarsource.com/msbuild/integration/2015/1">

  <Property Name="sonar.host.url">sonar.dnbad.nl</Property>

  <Property Name="sonar.login">...</Property>
  <Property Name="sonar.password">....</Property>

  <Property Name="sonar.verbose">true</Property>

  <!-- Required only for versions of SonarQube prior to 5.2 -->
  <!--
  <Property Name="sonar.jdbc.url">jdbc:jtds:sqlserver://mySqlServer/sonar;instance=SQLEXPRESS;SelectMethod=Cursor</Property>
  <Property Name="sonar.jdbc.username">sonar</Property>
  <Property Name="sonar.jdbc.password">sonar</Property>
  -->

</SonarQubeAnalysisProperties>

當我在SonarSource-sonar-examples-3e5f679運行示例時,得到以下輸出:

SonarQube Scanner for MSBuild 2.0
Default properties file was found at D:\ServApps\SonarQubeScannerForMSBuild\SonarQube.Analysis.xml
Loading analysis properties from D:\ServApps\SonarQubeScannerForMSBuild\SonarQube.Analysis.xml
sonar.verbose=true was specified - setting the log verbosity to 'Debug'
Pre-processing started.
Using environment variables to determine the download directory...
Preparing working directories...
Removing the existing directory: E:\test\projects\languages\csharp\ConsoleApplication1\.sonarqube
Creating directory: E:\test\projects\languages\csharp\ConsoleApplication1\.sonarqube
Creating directory: E:\test\projects\languages\csharp\ConsoleApplication1\.sonarqube\bin
SonarQube server url: sonar.dnbad.nl
Checking for updates...
Downloading SonarQube.MSBuild.Runner.Implementation.zip from sonar.dnbad.nl/static/csharp/SonarQube.MSBuild.Runner.Implementation.zip to E:\test\projects\languages\csharp\ConsoleApplication1\.sonarqube\bin\SonarQube.MSBuild.Runner.Implementation.zip

Unhandled Exception: System.Net.WebException: Could not find a part of the path 'E:\test\projects\languages\csharp\ConsoleApplication1\sonar.dnbad.nl\static\csharp\SonarQube.MSBuild.Runner.Implementation.zip'. ---> System.Net.WebException: Could not find a part of the path 'E:\test\projects\languages\csharp\ConsoleApplication1\sonar.dnbad.nl\static\csharp\SonarQube.MSBuild.Runner.Implementation.zip'. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'E:\test\projects\languages\csharp\ConsoleApplication1\sonar.dnbad.nl\static\csharp\SonarQube.MSBuild.Runner.Implementation.zip'.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
   at System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)
   at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
   --- End of inner exception stack trace ---
   at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
   at System.Net.FileWebRequest.GetResponseCallback(Object state)
   --- End of inner exception stack trace ---
   at System.Net.WebClient.DownloadFile(Uri address, String fileName)
   at System.Net.WebClient.DownloadFile(String address, String fileName)
   at SonarQube.Bootstrapper.BuildAgentUpdater.TryUpdate(String hostUrl, String targetDir, ILogger logger)
   at SonarQube.Bootstrapper.Program.PreProcess(IBuildAgentUpdater updater, IBootstrapperSettings settings, ILogger logger)
   at SonarQube.Bootstrapper.Program.Execute(String[] args, IBuildAgentUpdater updater, ILogger logger)
   at SonarQube.Bootstrapper.Program.Main(String[] args)

似乎跑步者正在嘗試創建路徑,但該路徑中包含聲納網址,而不是目錄.sonarcube\\bin

有什么建議么?

您要將主機名而不是URL傳遞給sonar.host.url ,因此要使用的方案不明確。 您應該完全定義URL:

<Property Name="sonar.host.url">http://sonar.dnbad.nl</Property>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM