为多个java项目设置sonar-runner [英] Setup sonar-runner for multiple java projects

查看:569
本文介绍了为多个java项目设置sonar-runner的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行sonar-runner来一次分析多个Java项目。根据文档,只需要创建一个<每个项目的code> sonar-project.properties 文件。但我不清楚我在哪里放置这些sonar-project.properties文件。

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.

我试图在 $ SONAR_RUNNER_HOME / conf 文件夹中添加多个.properties文件但是跑步者似乎没有接他们。它只能看到sonar-project.properties文件。

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.

关于如何为多个项目运行sonar-runner的任何建议?

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.

假设您在dev / general / BasicStuff,dev / service / CoolStuff,dev / utility / UtilStuff和dev / display / FrameWorkStuff中有4个项目。

Lets assume you have 4 projects in dev/general/BasicStuff, dev/service/CoolStuff, dev/utility/UtilStuff and dev/display/FrameWorkStuff.

此处所述 Way#2你在dev中创建一个包含行的文件

As described in hereWay #2 you create a file in dev which contains the line

sonar.modules=BasicStuff,CoolStuff,UtilStuff,FrameWorkStuff

对于每个模块,一行如

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

如果您以顶级属性作为目标启动声纳跑步者,您将获得全面的结果wh ich显示项目的指标,并允许您深入研究每个项目。

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.

希望这是你想要的。

这篇关于为多个java项目设置sonar-runner的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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