简体   繁体   English

所选模块的Sonarqube分析

[英]Sonarqube analysis for selected modules

I have a multimodules project with many dependencies. 我有一个具有许多依赖项的多模块项目。 Until now after successful build I was performing sonar analysis of whole project. 到目前为止,在成功构建之后,我一直在对整个项目进行声纳分析。 To save time and build project I detect which modules have been changed and run maven command: 为了节省时间和构建项目,我检测了哪些模块已更改并运行maven命令:

mvn install -pl module1,module5,module2 -amd

Is there any way to do static analysis only for built modules? 有什么方法可以仅对内置模块进行静态分析吗? Something like mvn sonar:sonar -pl module1,module5,module2 -amd? 像mvn sonar之类的东西:声纳-pl module1,module5,module2 -amd? of course it doesn't work, do you have any idea? 当然不行,你有什么主意吗?

I know that there is option: 我知道有选择:

mvn sonar:sonar -pl !module2 

but my project has more than 50 modules so if commit change only 5 modules I will have to list 45 others modules. 但是我的项目有50多个模块,所以如果提交更改仅5个模块,我将不得不列出45个其他模块。

SonarQube always requires full scan. SonarQube始终需要完整扫描。 If you exclude some modules and execute the scanner, then excluded modules will disappear from SonarQube. 如果排除某些模块并执行扫描仪,则排除的模块将从SonarQube中消失。 It means there is no such flag. 这意味着没有这样的标志。

Read more: How to analyse only new added lines of code? 阅读更多: 如何仅分析新添加的代码行?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM