sonarqube - 如何使用自定义属性文件名运行 Sonar Runner?示例 : sonar-project-abc. 属性

标签 sonarqube sonarqube-scan

我正在尝试在我的 javascript 项目上运行 Sonar 但它给了我一个错误。您能帮我了解如何使用自定义属性文件名运行 Sonar

C:\sonar-runner-2.4\bin\..
SonarQube Runner 2.4
Java 1.8.0_25 Oracle Corporation (32-bit)
Windows 7 6.1 x86
INFO: Runner configuration file: C:\sonar-runner-2.4\bin\..\conf\sonar-runner.pr
operties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is
 platform dependent)
INFO: Work directory: C:\Users\FS00341311\Workspaces\8\app\usage\.\.sonar
INFO: SonarQube Server 5.2
20:51:13.338 INFO  - Load global repositories
20:51:13.464 INFO  - Load global repositories (done) | time=124ms
20:51:13.477 INFO  - User cache: C:\Users\FS00341311\.sonar\cache
20:51:14.531 INFO  - Load plugins index
20:51:14.537 INFO  - Load plugins index (done) | time=6ms
20:51:14.734 INFO  - Process project properties
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 2.113s
Final Memory: 6M/73M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: You must define the following mandatory properties for 'Unknow
n': sonar.projectKey, sonar.projectName, sonar.projectVersion, sonar.sources
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with t
he -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.

最佳答案

您可以指定project.settings属性

sonar-scanner -Dproject.settings=sonar-project-abc.properties

参见https://docs.sonarqube.org/display/SCAN/Advanced+SonarQube+Scanner+Usages

关于sonarqube - 如何使用自定义属性文件名运行 Sonar Runner?示例 : sonar-project-abc. 属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36455494/

相关文章:

java - Sonar :sonar work?如何

maven - SonarQube "The main branch has no lines of code."问题,而 Jenkins 说分析成功

c# - 如何为 SonarQube 创建自己的 C# 自定义规则?

maven - Sonar Maven 插件 : How to use project-relative paths in inclusion patterns?

sonarqube - 如何在 SonarQube 中扫描隐藏文件夹,例如 ".nameFolder"?

javascript - 总体覆盖率指标并不反射(reflect)我的本地结果

docker - Sonarqube docker容器无法重新启动,离线

java - Sonar ANT 任务集成错误

java - SonarQube Eclipse 插件在本地分析时抛出错误

java - Sonar-runner执行失败导致cast异常