栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

Sonar入门到精通- maven pom文件忽略sonar扫描文件

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Sonar入门到精通- maven pom文件忽略sonar扫描文件


        
        
            src/main/java/com/xx/base*,
           
            src/main/java/com/xx*,
            src/main/resource*,
            src/test/java*
        
    
  • 原文

I have a project configured in maven and the code analysis is done by SonarQube.

I am trying to configure SonarQube in the pom.xml file to exclude a few files from the code analysis. Those files can be identified by their class names, they contain the underscore character before the extension (they are metamodel classes). Below I give the part of the pom.xml file where I try to exclude them:


    org.codehaus.mojo
    sonar-maven-plugin
    2.2
    
        src/main/java
        file:**/src/main/java*_.*
    

However, the above code does not work. Is there a way to configure SonarQube from my pom.xml file to ignore those files when analysing the source code?

Thank you in advance.

解决方案

Sonar exclusions (like other sonar properties)  section">have to be added to the section of the POM file. Like so (example from excluding jOOQ autogenerated code from current project):


    UTF-8
    http://www.example.com/
    jdbc:postgresql://www.example.com/sonar
    org.postgresql.Driver
    sonar
    sonar
    org/binarytherapy/generated*, **/GuiceBindComposer.java
    reuseReports
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/631892.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号