SonarQube的多模块项目分析 [英] Multi module project analysis with SonarQube

查看:1990
本文介绍了SonarQube的多模块项目分析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SonarQube Server 5.1.2, Sonar-Runner 2.4

Multi-moduleProject 我创建了一个项目结构

As provide in Multi-moduleProject i have created a project structure as

Accounts
|
->invoice
  |
   ->src

->receipt
  |
   ->src

->sonar.properties

File:sonar.properties

File:sonar.properties

sonar.projectKey=org.mycompany.acc
sonar.projectName=Account
sonar.projectVersion=1.0

sonar.sources=src

sonar.modules=invoice,receipt

invoice.sonar.projectName=Invoice
receipt.sonar.projectName=Receipt

在声纳运行器中使用上述配置执行时,在"Account"目录中丢失了错误"src"文件夹,我希望此配置与该链接中可用的conf相同.根据了解,如果配置很好,则发票和收据"将在帐户项目"下列为"<子项目" ,因此,为了在一个项目下实现多模块/项目,上述配置需要进行哪些更改?

When execute with above configuration in sonar-runner i encountered with error "src" folder is missing in "Account" directory, hope this configuration is same as the conf available in that link. As per the understanding if the configuration is fine then the Invoice and Receipt will be listed as sub project under Account Project, so what are the changes are required in above configuration to achieve multi module / project under one project.

错误

ERROR: Error during Sonar runner execution ERROR: Unable to execute Sonar ERROR: Caused by: The folder 'src' does not exist for 'org.mycompany.acc' (base directory = C:\Users\xyz\Accounts\.) ERROR: ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with t he -e switch. ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.

ERROR: Error during Sonar runner execution ERROR: Unable to execute Sonar ERROR: Caused by: The folder 'src' does not exist for 'org.mycompany.acc' (base directory = C:\Users\xyz\Accounts\.) ERROR: ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with t he -e switch. ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.

推荐答案

尝试一下:

sonar.projectKey=org.mycompany.acc
sonar.projectName=Account
sonar.projectVersion=1.0

sonar.sources=src # try to remove this by the way if you don't have suchdirectory under root folder of project

sonar.modules=invoice,receipt

invoice.sonar.projectName=Invoice
invoice.sonar.sources=invoice/src
receipt.sonar.projectName=Receipt
receipt.sonar.sources=receipt/src

这篇关于SonarQube的多模块项目分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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