声纳设置未定义的强制属性 [英] Sonar Setup Undefined Mandatory Properties

查看:19
本文介绍了声纳设置未定义的强制属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

学习如何使用 SonarQube 并从此处

Learning how to use SonarQube and was doing a quick install from here

一直到第 5 步.执行时我的构建失败:C:sonar-runnerinsonar-runner.bat

Got all the way down to step 5. My build fails when I execute: C:sonar-runnerinsonar-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 runner的文件夹中创建一个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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆