声纳安装未定义的强制属性 [英] Sonar Setup Undefined Mandatory Properties
本文介绍了声纳安装未定义的强制属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
学习如何使用SonarQube,并做一个快速从安装这里
Learning how to use SonarQube and was doing a quick install from here
得到一路下跌至第5步。当我执行我的生成失败:
C:\\声纳亚军\\ BIN \\声纳runner.bat
Got all the way down to step 5. My build fails when I execute: C:\sonar-runner\bin\sonar-runner.bat
我收到以下错误:
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 7.572s
Final Memory: 8M/223M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: You must define the following mandatory properties for 'Unknown': sonar.projectKey, sonar.projectName, sonar.projectVersion, sonar.sources
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
任何人都遇到类似的情况,并解决?
Anyone encountered a similar situation and resolved?
推荐答案
如果你有一个Java项目,必须创建在您执行声纳亚军的文件夹中的文件sonar-project.properties。您必须定义这个文件中的以下属性:
If you have a java project, you must create a sonar-project.properties file in the folder where you execute sonar runner. You must define the following properties inside this file:
# Required metadata
sonar.projectKey=java-sonar-runner-simple
sonar.projectName=Simple Java project analyzed with the SonarQube Runner
sonar.projectVersion=1.0
# Comma-separated paths to directories with sources (required)
sonar.sources=src
# Language
sonar.language=java
# Encoding of the source files
sonar.sourceEncoding=UTF-8
希望这有助于
这篇关于声纳安装未定义的强制属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文