我有一个Sonarqube服务器(6.7.1版本),安装了SonarC#(6.7.1版本),使用的是Bitnami Google Cloud平台。
我按照教程进行操作:https://docs.sonarqube.org/display/SCAN/Scanning+on+Linux+or+macOS,创建了一个新的空项目“ConsoleApp1”。
然而,在最后一步中: mono ~/Tools/ScannerMSBuild/SonarQube.Scanner.MSBuild.exe end /d:sonar.login=XYZ 会弹出一个异常。
我按照教程进行操作:https://docs.sonarqube.org/display/SCAN/Scanning+on+Linux+or+macOS,创建了一个新的空项目“ConsoleApp1”。
然而,在最后一步中: mono ~/Tools/ScannerMSBuild/SonarQube.Scanner.MSBuild.exe end /d:sonar.login=XYZ 会弹出一个异常。
Calling the SonarQube Scanner...
Unhandled Exception:
System.ComponentModel.Win32Exception (0x80004005): ApplicationName='/Users/magic/Documents/Projects/services/sonar-scanner-msbuild/sonar-scanner-3.0.3.778/bin/sonar-scanner', CommandLine='"-Dsonar.login=admin" "-Dsonar.scanAllFiles=true" "-Dsonar.password=xxxxxx" "-Dproject.settings=/Users/magic/Documents/Projects/c#/ConsoleApp1/.sonarqube/out/sonar-project.properties"', CurrentDirectory='/Users/magic/Documents/Projects/c#/ConsoleApp1', Native error= Access denied
at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x002dc] in <04fdc8acaa5e466bb267a3960bdb1f37>:0
at System.Diagnostics.Process.Start () [0x0003a] in <04fdc8acaa5e466bb267a3960bdb1f37>:0
at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
at SonarQube.Common.ProcessRunner.Execute (SonarQube.Common.ProcessRunnerArguments runnerArgs) [0x000df] in <184f94cfa81445e38fb1a98c6eca5c13>:0
at SonarScanner.Shim.SonarScannerWrapper.ExecuteJavaRunner (SonarQube.Common.AnalysisConfig config, System.Collections.Generic.IEnumerable`1[T] userCmdLineArguments, SonarQube.Common.ILogger logger, System.String exeFileName, System.String propertiesFileName) [0x00053] in <40209c7fedb345b0bc4e48d7b04dc4cc>:0
at SonarScanner.Shim.SonarScannerWrapper.InternalExecute (SonarQube.Common.AnalysisConfig config, System.Collections.Generic.IEnumerable`1[T] userCmdLineArguments, SonarQube.Common.ILogger logger, System.String fullPropertiesFilePath) [0x0001b] in <40209c7fedb345b0bc4e48d7b04dc4cc>:0
at SonarScanner.Shim.SonarScannerWrapper+<>c__DisplayClass6_0.<Execute>b__0 () [0x0003a] in <40209c7fedb345b0bc4e48d7b04dc4cc>:0
at SonarScanner.Shim.SonarProjectPropertiesValidator.Validate (System.String sonarScannerCwd, System.Collections.Generic.ICollection`1[T] projects, System.Action onValid, System.Action`1[T] onInvalid) [0x00082] in <40209c7fedb345b0bc4e48d7b04dc4cc>:0
at SonarScanner.Shim.SonarScannerWrapper.Execute (SonarQube.Common.AnalysisConfig config, System.Collections.Generic.IEnumerable`1[T] userCmdLineArguments, SonarQube.Common.ILogger logger) [0x00092] in <40209c7fedb345b0bc4e48d7b04dc4cc>:0
at SonarQube.TeamBuild.PostProcessor.MSBuildPostProcessor.InvokeSonarScanner (SonarQube.Common.IAnalysisPropertyProvider cmdLineArgs, SonarQube.Common.AnalysisConfig config) [0x00013] in <c02c645a99c24060a2edd0cf9161959e>:0
at SonarQube.TeamBuild.PostProcessor.MSBuildPostProcessor.Execute (System.String[] args, SonarQube.Common.AnalysisConfig config, SonarQube.TeamBuild.Integration.Interfaces.ITeamBuildSettings settings) [0x000c3] in <c02c645a99c24060a2edd0cf9161959e>:0
at SonarQube.Bootstrapper.BootstrapperClass.PostProcess () [0x00080] in <76e5086a486b4c68925b0809607fa8c1>:0
at SonarQube.Bootstrapper.BootstrapperClass.Execute () [0x00041] in <76e5086a486b4c68925b0809607fa8c1>:0
at SonarQube.Bootstrapper.Program.Execute (System.String[] args, SonarQube.Common.ILogger logger) [0x000dd] in <76e5086a486b4c68925b0809607fa8c1>:0
at SonarQube.Bootstrapper.Program.Main (System.String[] args) [0x00021] in <76e5086a486b4c68925b0809607fa8c1>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.ComponentModel.Win32Exception (0x80004005): ApplicationName='/Users/magic/Documents/Projects/services/sonar-scanner-msbuild/sonar-scanner-3.0.3.778/bin/sonar-scanner', CommandLine='"-Dsonar.login=admin" "-Dsonar.scanAllFiles=true" "-Dsonar.password=xxxxxx" "-Dproject.settings=/Users/magic/Documents/Projects/c#/ConsoleApp1/.sonarqube/out/sonar-project.properties"', CurrentDirectory='/Users/magic/Documents/Projects/c#/ConsoleApp1', Native error= Access denied
at System.Diagnostics.Process.StartWithCreateProcess (System.Diagnostics.ProcessStartInfo startInfo) [0x002dc] in <04fdc8acaa5e466bb267a3960bdb1f37>:0
at System.Diagnostics.Process.Start () [0x0003a] in <04fdc8acaa5e466bb267a3960bdb1f37>:0
at (wrapper remoting-invoke-with-check) System.Diagnostics.Process.Start()
at SonarQube.Common.ProcessRunner.Execute (SonarQube.Common.ProcessRunnerArguments runnerArgs) [0x000df] in <184f94cfa81445e38fb1a98c6eca5c13>:0
at SonarScanner.Shim.SonarScannerWrapper.ExecuteJavaRunner (SonarQube.Common.AnalysisConfig config, System.Collections.Generic.IEnumerable`1[T] userCmdLineArguments, SonarQube.Common.ILogger logger, System.String exeFileName, System.String propertiesFileName) [0x00053] in <40209c7fedb345b0bc4e48d7b04dc4cc>:0
at SonarScanner.Shim.SonarScannerWrapper.InternalExecute (SonarQube.Common.AnalysisConfig config, System.Collections.Generic.IEnumerable`1[T] userCmdLineArguments, SonarQube.Common.ILogger logger, System.String fullPropertiesFilePath) [0x0001b] in <40209c7fedb345b0bc4e48d7b04dc4cc>:0
at SonarScanner.Shim.SonarScannerWrapper+<>c__DisplayClass6_0.<Execute>b__0 () [0x0003a] in <40209c7fedb345b0bc4e48d7b04dc4cc>:0
at SonarScanner.Shim.SonarProjectPropertiesValidator.Validate (System.String sonarScannerCwd, System.Collections.Generic.ICollection`1[T] projects, System.Action onValid, System.Action`1[T] onInvalid) [0x00082] in <40209c7fedb345b0bc4e48d7b04dc4cc>:0
at SonarScanner.Shim.SonarScannerWrapper.Execute (SonarQube.Common.AnalysisConfig config, System.Collections.Generic.IEnumerable`1[T] userCmdLineArguments, SonarQube.Common.ILogger logger) [0x00092] in <40209c7fedb345b0bc4e48d7b04dc4cc>:0
at SonarQube.TeamBuild.PostProcessor.MSBuildPostProcessor.InvokeSonarScanner (SonarQube.Common.IAnalysisPropertyProvider cmdLineArgs, SonarQube.Common.AnalysisConfig config) [0x00013] in <c02c645a99c24060a2edd0cf9161959e>:0
at SonarQube.TeamBuild.PostProcessor.MSBuildPostProcessor.Execute (System.String[] args, SonarQube.Common.AnalysisConfig config, SonarQube.TeamBuild.Integration.Interfaces.ITeamBuildSettings settings) [0x000c3] in <c02c645a99c24060a2edd0cf9161959e>:0
at SonarQube.Bootstrapper.BootstrapperClass.PostProcess () [0x00080] in <76e5086a486b4c68925b0809607fa8c1>:0
at SonarQube.Bootstrapper.BootstrapperClass.Execute () [0x00041] in <76e5086a486b4c68925b0809607fa8c1>:0
at SonarQube.Bootstrapper.Program.Execute (System.String[] args, SonarQube.Common.ILogger logger) [0x000dd] in <76e5086a486b4c68925b0809607fa8c1>:0
at SonarQube.Bootstrapper.Program.Main (System.String[] args) [0x00021] in <76e5086a486b4c68925b0809607fa8c1>:0
有人知道如何解决这个问题吗?非常感谢。