How to skip a sub module in a sonar analysis in a multi module java project

杀马特。学长 韩版系。学妹 提交于 2019-12-06 19:05:54

问题


I have a multi module Maven project. I need to exclude one of the sub module from sonar anlaysis.

I run the mvn sonar:sonar from parent directory.

Is there a way to specify the exclusions in pom file or do we need to configure it in sonar qube.


回答1:


From the documentation:

You can either:

  • define property <sonar.skip>true</sonar.skip> in the pom.xml of the module you want to exclude
  • use build profiles to exclude some module (like for integration tests)
  • use Advanced Reactor Options (such as "-pl"). For example } mvn sonar:sonar -pl !module2


来源:https://stackoverflow.com/questions/30178581/how-to-skip-a-sub-module-in-a-sonar-analysis-in-a-multi-module-java-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!