使用mvn声纳运行声纳分析:声纳忽略sonar-project.properties [英] Running sonar analysis with mvn sonar:sonar ignores sonar-project.properties
问题描述
最新的3.3声纳maven插件和5.6 LTS作为网络服务器。
用 mvn声纳运行声纳分析:声纳
( Maven扫描仪)
忽略 sonar-project.properties
文件。 (有许多参数 https://docs.sonarqube.org/display/SONAR/Analysis+Parameters )
Latest 3.3 sonar-maven-plugin and 5.6 LTS as web server.
Running sonar analysis with mvn sonar:sonar
( Scanner for Maven )
ignores sonar-project.properties
file. (with many parameters https://docs.sonarqube.org/display/SONAR/Analysis+Parameters)
这是预期的行为吗?
所以我必须在中配置所有声纳参数pom.xml
文件?
Is it that the expected behavior?
So do I have to configure all sonar parameters within pom.xml
files?
推荐答案
这是正确的:Maven的扫描程序忽略了 sonar-project.properties
file。
That is correct: the scanner for Maven ignores the sonar-project.properties
file.
要在为Maven使用扫描仪时传递分析参数,
将它们设置为< properties>
在 pom.xml
中,例如:
To pass analysis parameters when using the scanner for Maven,
set them as <properties>
in the pom.xml
, for example:
<properties>
<sonar.host.url>http://yourserver</sonar.host.url>
</properties>
或者,您也可以使用 -D $ c $传递参数c>在命令行上,例如:
Or, you could also pass parameters using -D
on the command line, for example:
mvn sonar:sonar -Dsonar.host.url=http://yourserver
这篇关于使用mvn声纳运行声纳分析:声纳忽略sonar-project.properties的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!