Setup sonar-runner for multiple java projects(为多个 java 项目设置 sonar-runner)
问题描述
我正在尝试运行 sonar-runner 以一次性分析多个 Java 项目.根据 documentation,这只是创建一个 <每个项目的 code>sonar-project.properties 文件.但我不清楚我必须将这些 sonar-project.properties 文件放在哪里.
我尝试在 $SONAR_RUNNER_HOME/conf 文件夹中添加多个 .properties 文件,但跑步者似乎没有选择它们.它只看到 sonar-project.properties 文件.
关于如何为多个项目运行 sonar-runner 有什么建议吗?
其实让sonar runner分析多个项目,只要它们在同一个文件系统中,还是很简单的.只需将属性文件放在离项目不远的目录中即可.然后在此属性文件中声明您的每个项目.
假设您在 dev/general/BasicStuff、dev/service/CoolStuff、dev/utility/UtilStuff 和 dev/display/FrameWorkStuff 中有 4 个项目.
如 此处中所述,您可以通过方式 #2 创建一个dev 中包含该行的文件
sonar.modules=BasicStuff,CoolStuff,UtilStuff,FrameWorkStuff对于每个模块",一行
BasicStuff.sonar.projectBaseDir=general/BasicStuffCoolStuff.sonar.projectBaseDir=服务/CoolStuff在项目目录中,您依次创建一个包含其他所需信息的文件,例如
sonar.projectName=BasicStuffsonar.sources=src如果您以顶级属性作为目标启动 sonar runner,您将获得一个全面的结果,其中显示了项目中的指标,并允许您深入了解每个项目.
希望这就是你要找的.p>
I am trying to run sonar-runner to analyze multiple Java projects in one go. According to the documentation it is just a matter of creating a sonar-project.properties file for each project. But it is not clear to me where exactly I have to put these sonar-project.properties files.
I tried to add multiple .properties files in the $SONAR_RUNNER_HOME/conf folder but the runner does not seem to pick them up. It only sees the sonar-project.properties file.
Any suggestions on how to run sonar-runner for multiple projects?
Actually it is quite simple to let the sonar runner analyze multiple projects as long as they are in the same file system. Just put a properties file in a directory that is not to far away from the projects. Then declare each of your projects in this properties file.
Lets assume you have 4 projects in dev/general/BasicStuff, dev/service/CoolStuff, dev/utility/UtilStuff and dev/display/FrameWorkStuff.
As described in hereWay #2 you create a file in dev which contains the line
sonar.modules=BasicStuff,CoolStuff,UtilStuff,FrameWorkStuff
And for each of the "modules" a line like
BasicStuff.sonar.projectBaseDir=general/BasicStuff
CoolStuff.sonar.projectBaseDir=service/CoolStuff
Inside the project directories you in turn create a file which contains the other needed information, e.g.
sonar.projectName=BasicStuff
sonar.sources=src
If you start sonar runner with the top level properties as target you get a comprehensive result which shows metrics across the projects as well as allowing you to drill into each of them.
Hope this was what you were looking for.
这篇关于为多个 java 项目设置 sonar-runner的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:为多个 java 项目设置 sonar-runner
基础教程推荐
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- RabbitMQ:消息保持“未确认"; 2022-01-01
