当我运行 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 上分析的。
问题是 SonarQube C# Plugin实际上是针对 Windows .NET 生态系统的,您无论如何都可以在其中构建/维护 .NET 项目。它必须与 SonarQube Scanner for MSBuild 一起使用,这需要 MSBuild 14.0。
关于sonarqube 中的 C# 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36503605/