使用 SonarQube 进行多模块项目分析 [英] Multi module project analysis with SonarQube
问题描述
SonarQube 服务器 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
文件: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
在 sonar-runner 中执行上述配置时,我遇到错误帐户"目录中缺少src"文件夹,希望此配置与该链接中可用的 conf 相同.据了解,如果配置没问题,那么Invoice和Receipt将在Account Project下列为sub project,那么上述配置需要做哪些更改才能实现一个项目下的多模块/项目.
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.
错误
错误:Sonar runner 执行期间出错错误:无法执行声纳错误:原因:'org.mycompany.acc' 的文件夹'src' 不存在(base目录 = C:UsersxyzAccounts.)错误:错误:要查看错误的完整堆栈跟踪,请使用 t 重新运行 SonarQube Runnerhe -e 开关.错误:使用 -X 开关重新运行 SonarQube Runner 以启用完整的调试日志记录.
推荐答案
试试这个:
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屋!