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


基础教程推荐
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 降序排序:Java Map 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01