gpt4 book ai didi

batch-file - Sonar 设置未定义的强制属性

转载 作者:行者123 更新时间:2023-12-02 23:50:58 25 4
gpt4 key购买 nike

学习如何使用 SonarQube 并从 here 进行快速安装

一直到第 5 步。当我执行以下命令时,我的构建失败了: 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.

有人遇到过类似情况并解决了吗?

最佳答案

如果您有 java 项目,则必须在执行 sonar runner 的文件夹中创建 sonar-project.properties 文件。您必须在此文件中定义以下属性:

# 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

希望这有帮助,

关于batch-file - Sonar 设置未定义的强制属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21204350/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com