如何在多模块java项目中跳过声纳分析中的子模块 [英] How to skip a sub module in a sonar analysis in a multi module java project

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

问题描述

我有一个多模块 Maven 项目.我需要从声纳分析中排除其中一个子模块.

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

我从父目录运行 mvn sonar:sonar.

I run the mvn sonar:sonar from parent directory.

有没有办法在 pom 文件中指定排除项,还是我们需要在声纳 qube 中配置它.

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

推荐答案

来自文档:

您可以:

  • 在要排除的模块的 pom.xml 中定义属性 <sonar.skip>true</sonar.skip>
  • 使用构建配置文件排除某些模块(例如用于集成测试)
  • 使用高级反应器选项(例如-pl").例如 } mvn sonar:sonar -pl !module2
  • 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

这篇关于如何在多模块java项目中跳过声纳分析中的子模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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