且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SonarQube排除Maven模块

更新时间:2023-09-29 23:07:52

有两个记录的选项,将模块从SonarQube分析中排除;引用:

There are two documented options to exclude a module from a SonarQube analysis; quoting:

您可以:

  • 使用构建配置文件排除某些模块(例如集成测试)
  • 使用高级反应堆选项(例如"-pl").例如mvn sonar:sonar -pl!module2

由于您使用的是Jenkins,也许更简单的解决方案是使用-pl选项.这样,您将不会更改Maven项目中的任何配置,而只会更改Jenkins的配置.

Since you are using Jenkins, maybe the simpler solution is to use the -pl option. This way, you won't change any configuration in your Maven project and you will only change Jenkins configuration.