当我运行 sonar-runner 来分析我的简单 C# 项目时,分析因 SonarLint.Runner.exe 权限被拒绝错误而终止:
ERROR: Error during SonarQube Scanner execution
ERROR: java.io.IOException: Cannot run program "/opt/sonarqube-5.4/projects/ArturiCSharpSort/.sonar/SonarLint.Runner/SonarLint.Runner.exe": error=13, Permission denied
ERROR: Caused by: Cannot run program "/opt/sonarqube-5.4/projects/ArturiCSharpSort/.sonar/SonarLint.Runner/SonarLint.Runner.exe": error=13, Permission denied
ERROR: Caused by: error=13, Permission denied
有效地
-rw-r--r-- 1 root root 19456 Apr 5 11:14 .sonar/Lint.Runner/SonarLint.Runner.exe
以下是我的 sonar-project.properties:
# Root project information
sonar.projectKey=ArturiCSharpSort
sonar.projectName=ArturiCSharpSort
sonar.projectVersion=1.0
# Some properties that will be inherited by the modules
sonar.sources=.
#List of the module identifiers
#sonar.modules=
# Properties can obviously be overriden for
# each module - just prefix them with the module ID
#module1.sonar.projectName=
#module2.sonar.projectName=
我尝试对 SonarLint.Runner.exe 执行 chmod,但每次分析时都会重新构建。
如何对 C# 项目进行分析?
C#项目的分析必须在Windows环境下进行。这里失败了,因为该项目是在 Linux 上分析的。
问题是 SonarQubeC# 插件 http://docs.sonarqube.org/display/PLUG/C%23+Plugin实际上是针对 Windows .NET 生态系统的,无论如何您都可以在其中构建/维护 .NET 项目。它必须与适用于 MSBuild 的 SonarQube 扫描仪 http://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+MSBuild,这需要 MSBuild 14.0。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)